Version 0.4.4
Moderator: Forum Moderators
Yeah, multiplayer does require completely different strategies to single-player, and I think I prefer the idea of single player too.
However, it would be possible for us to investigate objective-oriented scenarios - e.g. to capture and control a certain location, or where one player has to get one of their units to a certain location, and the other player has to stop him.
David
However, it would be possible for us to investigate objective-oriented scenarios - e.g. to capture and control a certain location, or where one player has to get one of their units to a certain location, and the other player has to stop him.
David
Re: A hint
I am pretty sure that all these calls to memcpy() are simply standard containers moving around their underlying buffers. In particular, the stringstream used to build the result in preprocess_file(). It would be possible to optimize this by instead using a vector<char> and estimating the space needed, and calling reserve(), but I don't think that's where the performance problem is.zas wrote:It seems there's a bad loop somewhere:
...
ltrace.log:3007288:memcpy(0x40610008, "[multiplayer]\n\tname=The Isle of "..., 138429) = 0x40610008
obtained by ltrace -o ltrace.log ./wesnoth
gthen grep -n '\[multiplayer\]' ltrace.log
it's a truncated log.
there's a repeated memcpy(), copying each time one byte more ....
i suspect config loading code.
In the function show_title() in menu.cpp I have added a call, SDL_Delay(20); in the for(;; ) loop and it removes the high CPU on startup on my machine.
David
Last edited by Dave on September 5th, 2003, 9:52 am, edited 1 time in total.
About slow start
Yes, it seems we have a looped allocation and memcpy() smt like tha t (pseudo code):
while (x) {
p = realloc(p, psize+1);
memcpy(p, src, psize+1);
...
}
About SDL_Wait(), well, if it works
while (x) {
p = realloc(p, psize+1);
memcpy(p, src, psize+1);
...
}
About SDL_Wait(), well, if it works
Ahhh I see how you did it now.miyo wrote:
Yes, I did complete Scenario 1 on first try
http://www.sgic.fi/crossbow/wesnoth/Scenario1Turn11.gz
My strategy was to send most the fighters the way you did, but send Delfador and Konrad and a couple of fighters along the road west, then to cross the river by Chantal, and try to head north along the edge of the playing board.
When Delfador and Konrad aren't specifically targetted, this may be a good strategy, but when they are targetted like on hard, this is probably not such a good strategy - by the time I crossed the river, I was heavily blockaded, and had to fight desperately to get through. Only a few lucky rolls allowed me to get through. Delfador was hopelessly trapped, and about to be killed next turn, but Konrad just made it to the signpost in time.
I did manage to finish the scenario with several fighters and a 4-hitpoint hero though!
Unfortunately this was an intermediate version of the game which has been changed slightly since, so a replay wouldn't be possible
David
Re: Please provide a way to shorten downloads
I have sent a request to register the project at sourceforge. Successful registration will give access to a CVS server which will allow me to put the source in CVS. Hopefully this'll make it easier for you.zas wrote:Either provide a differential patch
against previous version or split wesnoth
David
compile problem
Hello, with 0.4.4 I had two errors when compiling.
I fixed it with 3 include lines in the code.
I use Debian Linux 3.0 with gcc 2.95.4 (oldish)
The changes:
In namegen.cpp
#include <cstdio>
In map.cpp
#include <algorithm>
I fixed it with 3 include lines in the code.
I use Debian Linux 3.0 with gcc 2.95.4 (oldish)
The changes:
In namegen.cpp
#include <cstdio>
In map.cpp
#include <algorithm>