|
You last visited: Today at 19:24
Advertisement
[Development] 4267 conquer server.
Discussion on [Development] 4267 conquer server. within the CO2 Private Server forum part of the Conquer Online 2 category.
03/08/2010, 14:26
|
#196
|
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
|
Quote:
Originally Posted by ChingChong23
@Viscount S: i understand that you guys wish to keep memory usage low, but you wouldn't even sacrifice a couple of mb's at max (and not even that much if done correctly) of memory for a much better structure? Memory in this situation should not even be considered. For example you saying Millions of Dialog instances can be created, while that is possible if someone decided to spam a million packets to talk to an NPC, and that's even if you have not handled it to even have a delay or check if he's already interacting with an NPC, then yes. But that's not going to happen?
@CptSky: sorry, i don't know much about .net and/or it's collections but you get the point.
|
I get fussy about memory issues. Just because the GC handles memory compaction, that means that we should not care about memory and performance.
Also a switch statement isn't a series of if elses, it is more of a goto table:
Code:
switch(VAL)
{
goto case<VAL>;
case 0:
// code gets executed.
goto END;
case 1:
//code gets executed
goto END;
}
END:
|
|
|
03/08/2010, 17:39
|
#197
|
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
|
Quote:
Originally Posted by ChingChong23
@Viscount S: i understand that you guys wish to keep memory usage low, but you wouldn't even sacrifice a couple of mb's at max (and not even that much if done correctly) of memory for a much better structure? Memory in this situation should not even be considered. For example you saying Millions of Dialog instances can be created, while that is possible if someone decided to spam a million packets to talk to an NPC, and that's even if you have not handled it to even have a delay or check if he's already interacting with an NPC, then yes. But that's not going to happen?
@CptSky: sorry, i don't know much about .net and/or it's collections but you get the point.
|
Do you even understand the concept of memory usage and how it works with creating new instances and switch statements?
|
|
|
03/08/2010, 17:59
|
#198
|
elite*gold: 0
Join Date: Apr 2008
Posts: 44
Received Thanks: 0
|
i don't understand a **** of what you guys are talking about, but just keep up the good work :P, and can someone tell me how far the progress of the server is in %? tnx
|
|
|
03/08/2010, 19:47
|
#199
|
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
|
Clear progress and plans on CPX;
Is the source ready yet?
We're basicly far enough to launch a beta, we're just fixing up little things.
How long will the beta last?
Till the summer.
What will happen then?
We will switch to native C++ instead.
How long will that take?
We have already done the dataserver and the defender. I'm currently working on the webserver with own scripting language; Current progress:
[Script]
string Text = "";
string ImagePath = "C:\CPW\Root\img\Logo.png";
// You always have to seperate the definitions and functions with a line of eachother.
Begin:
{
RenderImage(ImagePath, 4, 1, 12); //Target, Left,Right,Top
RenderText(Text, 4, 1, 12); //Target, Left,Right,Top
//The text will be on top of the image (They go in order).
}
End:
Only thing left is the source.
|
|
|
03/09/2010, 00:40
|
#200
|
elite*gold: 0
Join Date: Dec 2009
Posts: 53
Received Thanks: 3
|
Quote:
Originally Posted by ChingChong23
@Viscount S: i understand that you guys wish to keep memory usage low, but you wouldn't even sacrifice a couple of mb's at max (and not even that much if done correctly) of memory for a much better structure? Memory in this situation should not even be considered. For example you saying Millions of Dialog instances can be created, while that is possible if someone decided to spam a million packets to talk to an NPC, and that's even if you have not handled it to even have a delay or check if he's already interacting with an NPC, then yes. But that's not going to happen?
|
I agree, there are better ways to approach the handling of NPCs, but the memory footprint of each class and its counterparts can play a key role in a server's stability. I will cede that memory usage shouldn't be an issue at the moment (because we all know premature optimization is the root of all evil), and sometimes object creation is more appropriate to create objects to enhance clarity or for simplicity. But it can also be expensive, which is the point I am trying to convey. My point is not memory usage or the garbage collector, but it can effect speed drastically.
I assume you have a background in Java, therefore I'll provide this example from Effective Java by Joshua Bloch:
Item 5: Avoid creating unnecessary objects
Code:
// Hideously slow program! Can you spot the object creation?
public static void main(String[] args) {
Long sum = 0L;
for (long i = 0; i <= Integer.MAX_VALUE; i++) {
sum += i;
}
System.out.println(sum);
}
"Changing the declaration of sum from Long to long reduces the runtime from 43 seconds to 6.8 seconds on my machine."
It is considered good practice to treat your code as if it were a public API, especially now that you have released it. You don't know how that code will be used, anything could happen, even if it's accidental. The code above could be chalked up to a typographical error.
|
|
|
03/09/2010, 03:31
|
#201
|
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
|
Quote:
Originally Posted by Nullable
I get fussy about memory issues. Just because the GC handles memory compaction, that means that we should not care about memory and performance.
Also a switch statement isn't a series of if elses, it is more of a goto table:
Code:
switch(VAL)
{
goto case<VAL>;
case 0:
// code gets executed.
goto END;
case 1:
//code gets executed
goto END;
}
END:
|
It's more like a table of offsets and it has to "if check" to find the right one.
You can't just "goto" a case value if you don't know where it is.
Kindof a combination of both.
|
|
|
03/09/2010, 04:47
|
#202
|
elite*gold: 0
Join Date: Jun 2009
Posts: 93
Received Thanks: 17
|
Quote:
Originally Posted by ImmuneOne
Clear progress and plans on CPX;
Is the source ready yet?
We're basicly far enough to launch a beta, we're just fixing up little things.
How long will the beta last?
Till the summer.
What will happen then?
We will switch to native C++ instead.
How long will that take?
We have already done the dataserver and the defender. I'm currently working on the webserver with own scripting language; Current progress:
[Script]
string Text = "";
string ImagePath = "C:\CPW\Root\img\Logo.png";
// You always have to seperate the definitions and functions with a line of eachother.
Begin:
{
RenderImage(ImagePath, 4, 1, 12); //Target, Left,Right,Top
RenderText(Text, 4, 1, 12); //Target, Left,Right,Top
//The text will be on top of the image (They go in order).
}
End:
Only thing left is the source.
|
Sounds great I really do hope that the server lasts longer than Conquecide did :/ That server ended up shutting down due to lack of interest I believe but anyways like any 1.0 server ran by a good coder i'll be following this forum thread till the server beta is up  Hope to see it soon, you guys seem determined and know what your doing so it makes a change, also glad it's going lvling server.
Regards,
Limbo.
|
|
|
03/09/2010, 07:32
|
#203
|
elite*gold: 0
Join Date: Feb 2006
Posts: 550
Received Thanks: 82
|
Quote:
Originally Posted by Viscount S
I agree, there are better ways to approach the handling of NPCs, but the memory footprint of each class and its counterparts can play a key role in a server's stability. I will cede that memory usage shouldn't be an issue at the moment (because we all know premature optimization is the root of all evil), and sometimes object creation is more appropriate to create objects to enhance clarity or for simplicity. But it can also be expensive, which is the point I am trying to convey. My point is not memory usage or the garbage collector, but it can effect speed drastically.
I assume you have a background in Java, therefore I'll provide this example from Effective Java by Joshua Bloch:
Item 5: Avoid creating unnecessary objects
Code:
// Hideously slow program! Can you spot the object creation?
public static void main(String[] args) {
Long sum = 0L;
for (long i = 0; i <= Integer.MAX_VALUE; i++) {
sum += i;
}
System.out.println(sum);
}
"Changing the declaration of sum from Long to long reduces the runtime from 43 seconds to 6.8 seconds on my machine."
It is considered good practice to treat your code as if it were a public API, especially now that you have released it. You don't know how that code will be used, anything could happen, even if it's accidental. The code above could be chalked up to a typographical error.
|
I completely understand where your coming from, since I've proven memory is not an issue ill go on speed. I would not suggest using this if it was going to get called several thousands of times a second, but lets estimate how many of these objects would be created on a server been online for a week. ill estimate 1000 NPC interactions (and yes this is more than people would do) lets say they click 3 options, theres 3k dialog instances created. On my computer running this code
Code:
long curTime = System.currentTimeMillis();
Long sum = 0L;
for (long i = 0; i <= 5000; i++) {
sum += i;
}
System.out.println("Finished: " + (System.currentTimeMillis() - curTime));
Running this code takes 1millisecond, running it using long takes 0 milliseconds. Your not willing to drop a few milliseconds over your entire server time for a better structure?
I also like the amount of knowledge in this topic, don't see much of it on epvp.
|
|
|
03/09/2010, 09:03
|
#204
|
elite*gold: 0
Join Date: Jul 2006
Posts: 112
Received Thanks: 26
|
So just wondering guys, Do you have a site where I can check to see updates and such?
|
|
|
03/09/2010, 09:11
|
#205
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Quote:
Originally Posted by ChingChong23
I completely understand where your coming from, since I've proven memory is not an issue ill go on speed. I would not suggest using this if it was going to get called several thousands of times a second, but lets estimate how many of these objects would be created on a server been online for a week. ill estimate 1000 NPC interactions (and yes this is more than people would do) lets say they click 3 options, theres 3k dialog instances created. On my computer running this code
Code:
long curTime = System.currentTimeMillis();
Long sum = 0L;
for (long i = 0; i <= 5000; i++) {
sum += i;
}
System.out.println("Finished: " + (System.currentTimeMillis() - curTime));
Running this code takes 1millisecond, running it using long takes 0 milliseconds. Your not willing to drop a few milliseconds over your entire server time for a better structure?
I also like the amount of knowledge in this topic, don't see much of it on epvp.
|
Just try to keep in mind the fact that each programmer has their own style, and that he likes to do things a certain way, just like you like to do things a certain way, he doesnt have to drop a few milliseconds if he doesnt want to.
You have made your arguement, leave it at that, your starting to sound slightly pushy about it.
|
|
|
03/09/2010, 10:49
|
#206
|
elite*gold: 0
Join Date: Feb 2006
Posts: 550
Received Thanks: 82
|
Sorry i didn't mean to sound pushy if it came off like that, this is constructive criticism/advice.
|
|
|
03/09/2010, 15:54
|
#207
|
elite*gold: 0
Join Date: Apr 2008
Posts: 44
Received Thanks: 0
|
Quote:
Originally Posted by ImmuneOne
Clear progress and plans on CPX;
Is the source ready yet?
We're basicly far enough to launch a beta, we're just fixing up little things.
How long will the beta last?
Till the summer.
What will happen then?
We will switch to native C++ instead.
How long will that take?
We have already done the dataserver and the defender. I'm currently working on the webserver with own scripting language; Current progress:
[Script]
string Text = "";
string ImagePath = "C:\CPW\Root\img\Logo.png";
// You always have to seperate the definitions and functions with a line of eachother.
Begin:
{
RenderImage(ImagePath, 4, 1, 12); //Target, Left,Right,Top
RenderText(Text, 4, 1, 12); //Target, Left,Right,Top
//The text will be on top of the image (They go in order).
}
End:
Only thing left is the source.
|
tnx for going back to things i understand :P
|
|
|
03/10/2010, 00:03
|
#208
|
elite*gold: 0
Join Date: Jun 2009
Posts: 378
Received Thanks: 141
|
Quote:
Running this code takes 1millisecond, running it using long takes 0 milliseconds. Your not willing to drop a few milliseconds over your entire server time for a better structure?
I also like the amount of knowledge in this topic, don't see much of it on epvp.
|
This is all nice theory I have to say if you want 100% accuarate information use a Nano Second wrapper. I use a wrapper I found on the internet with some modified code and it works well for accurate timing 1/billionth of a second  .
"A nanosecond is equal to 1000 picoseconds or 1/1000 microsecond. Because the next SI unit is 1000 times larger, times of 10-8 and 10-7 seconds are typically expressed as tens or hundreds of nanoseconds." Wiki
Link : Nanosecond - Wikipedia, the free encyclopedia
|
|
|
03/10/2010, 00:22
|
#209
|
elite*gold: 0
Join Date: Dec 2009
Posts: 53
Received Thanks: 3
|
Quote:
Originally Posted by ImFlamedCOD
...
|
Correct. Measuring how long some code takes to execute can be accomplished more precisely so by utilizing  , and this method is only there to measure elapsed time in Java. Although, I trust that ChingChong23's results are accurate enough to make his/her point clear. But as Korvacs pointed out, we all have our own style, so perhaps we can agree to disagree.
|
|
|
03/10/2010, 15:54
|
#210
|
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
|
What would be acccurate chances for upgrading with meteors and dragonballs?.
|
|
|
All times are GMT +1. The time now is 19:27.
|
|