Re: [Super-tux-devel] SuperTux 0.1.2 ported to Zaurus SL-C860
Brought to you by:
wkendrick
|
From: Dennis W. <den...@vu...> - 2005-01-09 13:53:20
|
Op za, 08-01-2005 te 13:00 +0000, schreef Ricardo Cruz: > Em Quinta, 6 de Janeiro de 2005 15:25, o Dennis Wagelaar escreveu: > > Hello! > > > > With the help of Ricardo Cruz, I managed to get the memory usage of > > SuperTux 0.1.2 back in check. The culprit was lisp_reader system, which > > has now been replaced by a new version that Ricoardo sent me. > > > Okay, just committed the change of LispReader to CVS supertux_0_1_1_branch. > There might not be another 0.1.x release, but just in case... > For those that want to make SuperTux 0.1.2 running on a palmtop, you can just > copy lisp_reader.cpp from 0.1.1 or, better yet, get it from CVS > supertux_0_1_1_branch. > > The modification on LispReader that caused such a bug was the change of a > recursive function by a iterative one, in order to make SuperTux working on > MacOS 10.2. LispReader's author sent me a patch, but Matze decided to follow > his own approach using STL. Aparentely, STL from those palmtops is badly > implemented. Anyway, author's solution is the best cause it's lighter and > doesnt waste memory uselessly. > CVS doesn't suffer from this problem, since the Lisp parser is a totally > different implementation. > I've seen that the LispReader already had some functionality for reading gzipped files using zlib, but it wasn't complete. I've made some additional changes to LispReader (not that many) to have complete support for gzipped files. That also required some changes throughout the code to look for .gz versions of the .st* files in addition to looking for the normal files. This should save some valuable flash memory megabytes ;-). Note that the game should still work with the normal, non-compressed files. > > Next, I decided to convert the whole shebang to fixed point arithmetic. > > That definitely *wasn't* fun. My third attempt worked out reasonably, > > with only broken OpenGL support (which you won't want anyway on a non- > > FPU machine). > > > Just make sure to keep position, velocity and other stuff that matter in > floats! > Fixed point is actually meant to replace floating point numbers where integers don't suffice. So the physics stuff that is meant to keep track of between-pixel position/velocity/acceleration data is now implemented using 14 bit behind comma fixed point numbers (that is about 4 decimal digits behind the comma). This means we may lose some precision, but some testing showed there was enough precision left. Most of the drawing code is now implemented using normal integers; it already truncated all the floats to integers anyway. > > Anyway, it was worth the speed-up: with the floating point emulation, > > the frame rate was somewhere around 6-9 fps, while now it is 11-12 fps! > > Still not amazing, but a lot more playable than before. > > > I guess it is a good enough change, as long as it doesn't mean any lost in > anything else. > It shouldn't right now, but I haven't extensively tested the level editor, nor have I tried to play each and every level. If this is to go into CVS, I would suggest using a new branch, e.g. supertux_0_1_2_fixed_point, until this code is thoroughly tested. > > The patch should be applied to the 0.1.2 release version of the source > > code and can be downloaded here: > > http://ssel.vub.ac.be/Members/DennisWagelaar/download/zaurus/supertux-0.1.2 > >-fp.patch.gz > > > The problem about your patch is that it modifies automake and all that stuff. > Just have a look at it. > Please, make a new patch only against src/. > I've made a new patch against the src directory only, but it still includes changes to configure.ac, the Makefile.am files, CREDITS and ChangeLog... The new patch also includes the new zlib LispReader code and a small change that prevents BadGuys from getting stuck in the ground on slow systems (see line 347 in badguy.cpp after patching). That last change may also be useful for the normal (floating point) branch, since I've heard from someone with a Pentium 200 MHz PC that he had the same problem. > > For the binary package for the zaurus, use the feed (also contains all > > the dependencies): > > http://ssel.vub.ac.be/Members/DennisWagelaar/download/zaurus/ > > > May we include a link for it in our download section? > You may ;-). > Cheers, > Ricardo > > > Best regards, > > Dennis Wagelaar > > > > Dennis |