Merging shaped_arenas into HEAD (complete)
-
Luke-Jr
- Dr Z Level
- Posts: 2246
- Joined: Sun Mar 20, 2005 4:03 pm
- Location: IM: luke@dashjr.org
- philippeqc
- Long Poster - Project Developer - Sage
- Posts: 1526
- Joined: Mon Jul 12, 2004 8:55 am
- Location: Stockholm
- Contact:
-
Luke-Jr
- Dr Z Level
- Posts: 2246
- Joined: Sun Mar 20, 2005 4:03 pm
- Location: IM: luke@dashjr.org
Everything you can put into a config file can also simply be entered at the console. Both paths get handled by the same code. But, as Luke points out, the console is a bit cumbersome for entering correct URLS. At the moment, the best way is to create configuration files map1.cfg, map2.cfg with just the right map selection command and enter at the console. Later, there should be a resource selection menuitem in the game settings menu, of course, but it does not really make much sense to code one while the resource system is in a state of high flux.
Code: Select all
include map1.cfg-
Luke-Jr
- Dr Z Level
- Posts: 2246
- Joined: Sun Mar 20, 2005 4:03 pm
- Location: IM: luke@dashjr.org
Merged
shaped_arenas has been merged into HEAD.
The shaped_arenas branch is now considered deprecated and all changes should go into HEAD.
The shaped_arenas branch is now considered deprecated and all changes should go into HEAD.
Great! And it works out of the box.
I changed three small things that you only notice in non-default compilations:
If you set CXXFLAGS="-DDEBUG -ggdb", the tASSERT assertions get checked. I should have documented this, I know... Anyway, if you do this, the assertions in tResourceManager::openResource complain about a missing URI argument. Since the code afterwards works fine without the assertion, I simply removed it.
I also redeclared the winding number in eAxis to be unsigned: there was one compiler warning about an unsigned to signed comparison ( an unsigned i with the signed numberWinding ) and I figured that the numberWinding member really should be unsigned. Not that we need the full range of an unsigned it
Sorry, I just tend to compile with maximal sensible warnings enabled and warnings as errors.
Lastly, the aParser member of gGame was a memory leak ( you get told these things too with -DDEBUG and the --enable-memmanager argument to configure ), I added an appropriate delete command in the gGame destructor, the alternative to that would be using std::auto_ptr< gParser > instead of gParser* in the header.
Anyway, I thought I'd mention this before the "Woot! You changed my code! Why? It's working fine!" comments come rolling in. The code indeed was working fine under normal circumstances, but not for me with my picky development environment.
I changed three small things that you only notice in non-default compilations:
If you set CXXFLAGS="-DDEBUG -ggdb", the tASSERT assertions get checked. I should have documented this, I know... Anyway, if you do this, the assertions in tResourceManager::openResource complain about a missing URI argument. Since the code afterwards works fine without the assertion, I simply removed it.
I also redeclared the winding number in eAxis to be unsigned: there was one compiler warning about an unsigned to signed comparison ( an unsigned i with the signed numberWinding ) and I figured that the numberWinding member really should be unsigned. Not that we need the full range of an unsigned it
Lastly, the aParser member of gGame was a memory leak ( you get told these things too with -DDEBUG and the --enable-memmanager argument to configure ), I added an appropriate delete command in the gGame destructor, the alternative to that would be using std::auto_ptr< gParser > instead of gParser* in the header.
Anyway, I thought I'd mention this before the "Woot! You changed my code! Why? It's working fine!" comments come rolling in. The code indeed was working fine under normal circumstances, but not for me with my picky development environment.
-
Luke-Jr
- Dr Z Level
- Posts: 2246
- Joined: Sun Mar 20, 2005 4:03 pm
- Location: IM: luke@dashjr.org
That was part of the plan... but I'm not so sure if it does.z-man wrote:Great! And it works out of the box.
I did a checkout in a new directory and whenever that one connects to a server, all text becomes a solid line and quality is lowest... I can guess the menu enough to restore defaults and then it works. Might not be caused by shaped, tho...
I haven't a clue what tASSERT does... I just assumed it's some debug thing that I can ignore.z-man wrote:I changed three small things that you only notice in non-default compilations:
If you set CXXFLAGS="-DDEBUG -ggdb", the tASSERT assertions get checked. I should have documented this, I know... Anyway, if you do this, the assertions in tResourceManager::openResource complain about a missing URI argument. Since the code afterwards works fine without the assertion, I simply removed it.
I did a bit of -Wall testing before merging and didn't notice it, but the fewer warnings, the betterz-man wrote:I also redeclared the winding number in eAxis to be unsigned: there was one compiler warning about an unsigned to signed comparison ( an unsigned i with the signed numberWinding ) and I figured that the numberWinding member really should be unsigned. Not that we need the full range of an unsigned itSorry, I just tend to compile with maximal sensible warnings enabled and warnings as errors.
C++ stuff, I guess. I really don't know C++, just C, and I'm sure it shows in some of my code (using char * and stuff)z-man wrote:Lastly, the aParser member of gGame was a memory leak ( you get told these things too with -DDEBUG and the --enable-memmanager argument to configure ), I added an appropriate delete command in the gGame destructor, the alternative to that would be using std::auto_ptr< gParser > instead of gParser* in the header.
If a change is needed, feel free to change itz-man wrote:Anyway, I thought I'd mention this before the "Woot! You changed my code! Why? It's working fine!" comments come rolling in. The code indeed was working fine under normal circumstances, but not for me with my picky development environment.
As far as I'm aware, though, the shaped code should all be working now and 0.2.8 is just waiting for whatever the other incomplete features are in CVS to be finished/stable.
- philippeqc
- Long Poster - Project Developer - Sage
- Posts: 1526
- Joined: Mon Jul 12, 2004 8:55 am
- Location: Stockholm
- Contact:
I get the feeling this one is going to hover over my head for a long time ;)z-man wrote:Anyway, I thought I'd mention this before the "Woot! You changed my code! Why? It's working fine!" comments come rolling in.
I see no reasons not to at least try to hold myself to your standard. Thanks for the pointers.z-man wrote:The code indeed was working fine under normal circumstances, but not for me with my picky development environment.
No problem at all with any of your changes. I should run more often with CXXFLAGS=" -ggdb -Wall" myself. Now I know about -DDEBUG.
I'll invest time to investigate that one so I dont repeat this type of mistake. I must confess I do not fully understand the alternative at the moment.Lastly, the aParser member of gGame was a memory leak ( you get told these things too with -DDEBUG and the --enable-memmanager argument to configure ), I added an appropriate delete command in the gGame destructor, the alternative to that would be using std::auto_ptr< gParser > instead of gParser* in the header.
-ph
Canis meus id comedit.
os x:
With the var directory now set to ~/Library/Application Support/Armagetron, the game crashes on startup. I had to change back to /Library... to fix it.
Maps are not loaded from the /Library/... folder, rather they are loaded from Armagetron.app/Contents/Resources/resource (after i copied over the resource folder). Ideally, the should be in the var directory, for when a user upgrades.
I really really wish xml2 and libpng had options to compile as a Framework for os x. Would have saved me alot of trouble.
I got it working though. I can connect to the shaped arena server, but when I take a screenshot game crashes.
On the shaped arena test server, the rim wall textures on some walls are stretched (sorry, can't get a screenshot).
I'll test out the binary on another os x box to see if it works.
gj
edit: the rim walls are transparent, which is a little annoying. Was this a side effect or intended?
edit2: anyway to have a map, and not have to run a webserver to host it? shouldn't the game handle it?
With the var directory now set to ~/Library/Application Support/Armagetron, the game crashes on startup. I had to change back to /Library... to fix it.
Maps are not loaded from the /Library/... folder, rather they are loaded from Armagetron.app/Contents/Resources/resource (after i copied over the resource folder). Ideally, the should be in the var directory, for when a user upgrades.
I really really wish xml2 and libpng had options to compile as a Framework for os x. Would have saved me alot of trouble.
Code: Select all
Thread 0 Crashed:
0 libSystem.B.dylib 0x9000421c szone_malloc + 1920
1 libSystem.B.dylib 0x90003a3c malloc_zone_malloc + 100
2 libSystem.B.dylib 0x900039a0 malloc + 1436
3 libpng12.0.dylib 0x00f26540 png_malloc + 80 (icplusplus.c:28)
4 libpng12.0.dylib 0x00f11bfc png_write_start_row + 136 (icplusplus.c:28)
5 libpng12.0.dylib 0x00f18f48 png_write_row + 88 (icplusplus.c:28)
6 libpng12.0.dylib 0x00f19f8c png_write_image + 216 (icplusplus.c:28)
7 net.sf.armegetron 0x000416c4 SDL_SavePNG(SDL_Surface*, tString) + 500 (rSysdep.cpp:289)
8 net.sf.armegetron 0x000419f0 make_screenshot() + 740 (rSysdep.cpp:347)I'll test out the binary on another os x box to see if it works.
gj
edit: the rim walls are transparent, which is a little annoying. Was this a side effect or intended?
edit2: anyway to have a map, and not have to run a webserver to host it? shouldn't the game handle it?
How about a preconfigured apache server? If that's too big, I can throw together a little python webserver you can distribute with it, preconfigured to run on a non-standard port, customized for the game (so it'll only retrieve files from the game). Python's got a neat little class for webservers.
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN
Be the devil's own, Lucifer's my name.
- Iron Maiden
Be the devil's own, Lucifer's my name.
- Iron Maiden
- philippeqc
- Long Poster - Project Developer - Sage
- Posts: 1526
- Joined: Mon Jul 12, 2004 8:55 am
- Location: Stockholm
- Contact:
os x path problem: I'll let this into Luke's capable hand, as he also seem to have acces to a mac.
On the topic of "is that a desired behavior or not", I'd prefer to take that discussion much later in the world development, as many such artefacts are going to appear, and any decisions are not likely to consider the full scope of the environment but rather only the current problem.
I just hope hope that the majority will come to see the transparent wall as a positive side effect for the time being.
I understand that the current model (uri and filename) is quite unfriendly. It is sadly only core functionality that has been exposed, and wasnt supposed to be more than that. A more convenient interface might come from the "resource management" discussion/development.
-ph
Would http://www.zveno.com/open_source/libxml2xslt.html help you? Are Framework some sort of libraries? If so, could you teach me what are the extra steps required to use them in os x?I really really wish xml2 and libpng had options to compile as a Framework for os x.
Same on linux and windows.but when I take a screenshot game crashes.
tygj ;)
Side effect. But I've come to love it. It allow you to view what is lurking behind the bend of a wall.edit: the rim walls are transparent, which is a little annoying. Was this a side effect or intended?
On the topic of "is that a desired behavior or not", I'd prefer to take that discussion much later in the world development, as many such artefacts are going to appear, and any decisions are not likely to consider the full scope of the environment but rather only the current problem.
I just hope hope that the majority will come to see the transparent wall as a positive side effect for the time being.
It has been decided that the game server shouldn't server "resources". But you aren't forced to host your own webserver, you can point to files hosted on any webserver, including this forum. You can attach a file to a post, and simply point to it. Also, Luke-jr has a web server where he seem to take great pride to host all the maps currently available.edit2: anyway to have a map, and not have to run a webserver to host it? shouldn't the game handle it?
I understand that the current model (uri and filename) is quite unfriendly. It is sadly only core functionality that has been exposed, and wasnt supposed to be more than that. A more convenient interface might come from the "resource management" discussion/development.
-ph
Canis meus id comedit.
-
Luke-Jr
- Dr Z Level
- Posts: 2246
- Joined: Sun Mar 20, 2005 4:03 pm
- Location: IM: luke@dashjr.org
Can you trace the crashes? As far as I can tell, the only difference is that ~/Library should work for non-Admin users.nemostultae wrote:os x:
With the var directory now set to ~/Library/Application Support/Armagetron, the game crashes on startup. I had to change back to /Library... to fix it.
Maps should be loaded from (in this order):nemostultae wrote:Maps are not loaded from the /Library/... folder, rather they are loaded from Armagetron.app/Contents/Resources/resource (after i copied over the resource folder). Ideally, the should be in the var directory, for when a user upgrades.
Code: Select all
~/Library/Application Support/Armagetron/resource/
APP/Contents/Resources/resource/included
~/Library/Application Support/Armagetron/resource/automaticScreenshots crash here too. So far, I'm blaming it on the new PNG screenshotsnemostultae wrote:I really really wish xml2 and libpng had options to compile as a Framework for os x. Would have saved me alot of trouble.I got it working though. I can connect to the shaped arena server, but when I take a screenshot game crashes.
Take it to that thread, please.
Known issue.nemostultae wrote:On the shaped arena test server, the rim wall textures on some walls are stretched (sorry, can't get a screenshot).
Side effect, but I personally like it and will want any changes to the behaviour to be an option (so I can get the original transparency back).nemostultae wrote:edit: the rim walls are transparent, which is a little annoying. Was this a side effect or intended?
So long as all your players have it, sure. Set MAP_URI to 0 and MAP_FILE to the map's proper filepath (eg HexaTRON/0.4.2.xml)nemostultae wrote:edit2: anyway to have a map, and not have to run a webserver to host it? shouldn't the game handle it?
Known. =pnemostultae wrote:hmm, winzone (and deathzones) have stopped working.
I have access to an OSX filesystem. =pphilippeqc wrote:os x path problem: I'll let this into Luke's capable hand, as he also seem to have acces to a mac.
The laptop is almost never running OSX itself, though, and we might be uninstalling it sometime soon.... unless there's use for it.
Not really pride... I just like to keep my maps in the same place.philippeqc wrote:It has been decided that the game server shouldn't server "resources". But you aren't forced to host your own webserver, you can point to files hosted on any webserver, including this forum. You can attach a file to a post, and simply point to it. Also, Luke-jr has a web server where he seem to take great pride to host all the maps currently available.
If guru3 will chmod g+w the htdocs directory on SF, I might be able to setup some kind of simple map library for people to upload them to...
I've been pondering parsing a single MAP_FILE variable formatted either "HexaTRON/0.4.2.xml" or "HexaTRON/0.4.2.xml(http://utopios.org/.../hexatron-0.4.2.xml)" into file/uri pairs based on "file(uri)" matching.philippeqc wrote:I understand that the current model (uri and filename) is quite unfriendly. It is sadly only core functionality that has been exposed, and wasnt supposed to be more than that. A more convenient interface might come from the "resource management" discussion/development.
The other problem would be getting the code to keep a library of file/uri pairs and automatically setting FILE_URI (or adding the "(...)" to the string) when it knows a source.
Edit: Duh. While I was typing ( and having breakfast in between, I don't type that slowly ), philippe and luke posted similar stuff. Sorry for possible redundancies.
How about if we add some development options to configure, like
Those ( minus -Wno-unused-variables, see below ) are the settings the external build module for eclipse uses.
I'd add --pedantic to the CXXFLAGS, but then the SDL headers don't compile. Maybe for the dedicated server? There are currently some unused variable warnings too ( in my code
) I'd have to get rid of first.
Luke: the menu and graphics error is probably my fault, it looks like the config file loading before the connect messes things up.
tASSERT stops the progam in debug mode if the argument evaluates to false ( resp. NULL for pointers or 0 for numerical values ) and prints a message where what assertion failed. Just like described in "man assert", but it opens a pretty message box in Windows.
Using char * is perfectly fine for easy stuff where you don't have to watch for overruns, like just passing a string constant around.
philippeqc: auto_ptr<> basically acts exactly like a normal pointer, with two exceptions: when it gets destroyed or overwritten, it automatically deletes the object it points to, and it has unusual assignment semantics: if a and b are auto_ptrs and you do a = b, then b is invalid ( NULL ) afterwards. That is to make sure that no two auto_ptrs try to delete the same object afterwards.
nemo: can't comment on the OsX specifics. Maybe there is code missing that creates the missing directories?
The screenshot problem exists in other OSes, too. I'll find out who's "guilty" and assign a bug report.
The wall "transparency" and stretchyness are known general problems, too. The rendering and texturing code was not yet adapted to the new possibilities. Luke and philippe: Should this be my job? I think I know what has to be done.
Any webserver will to do store your custom map, it does not have to run on the game server itself. The idea behind this instead of using an in-game mechanism is better load ballancing. So far, we have only maps as resources, the game server could certainly handle them. But later, there will also be textures, meshes and perhaps music. Ideally, we'd have a central server handling the most important custom resources, so not every server admin would need to run a webserver on his own.
Lucifer: the small python webserver could be a splendid idea. It could directly use the same folder for the resources as the game, so we'd have an automatic resource path to URI translation mechanism. Of course, this would dump the network load on the game server's machine, but that's the server admin's decision.
How about if we add some development options to configure, like
Code: Select all
--enable-development: adds "-Wall -Werror" to CXXFLAGS
--enable-debug: like above, plus "-ggdb -DDEBUG" to CXXFLAGS and plus the the leak finding memory managerI'd add --pedantic to the CXXFLAGS, but then the SDL headers don't compile. Maybe for the dedicated server? There are currently some unused variable warnings too ( in my code
Luke: the menu and graphics error is probably my fault, it looks like the config file loading before the connect messes things up.
tASSERT stops the progam in debug mode if the argument evaluates to false ( resp. NULL for pointers or 0 for numerical values ) and prints a message where what assertion failed. Just like described in "man assert", but it opens a pretty message box in Windows.
Using char * is perfectly fine for easy stuff where you don't have to watch for overruns, like just passing a string constant around.
philippeqc: auto_ptr<> basically acts exactly like a normal pointer, with two exceptions: when it gets destroyed or overwritten, it automatically deletes the object it points to, and it has unusual assignment semantics: if a and b are auto_ptrs and you do a = b, then b is invalid ( NULL ) afterwards. That is to make sure that no two auto_ptrs try to delete the same object afterwards.
nemo: can't comment on the OsX specifics. Maybe there is code missing that creates the missing directories?
The screenshot problem exists in other OSes, too. I'll find out who's "guilty" and assign a bug report.
The wall "transparency" and stretchyness are known general problems, too. The rendering and texturing code was not yet adapted to the new possibilities. Luke and philippe: Should this be my job? I think I know what has to be done.
Any webserver will to do store your custom map, it does not have to run on the game server itself. The idea behind this instead of using an in-game mechanism is better load ballancing. So far, we have only maps as resources, the game server could certainly handle them. But later, there will also be textures, meshes and perhaps music. Ideally, we'd have a central server handling the most important custom resources, so not every server admin would need to run a webserver on his own.
Lucifer: the small python webserver could be a splendid idea. It could directly use the same folder for the resources as the game, so we'd have an automatic resource path to URI translation mechanism. Of course, this would dump the network load on the game server's machine, but that's the server admin's decision.