Merging shaped_arenas into HEAD (complete)

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
User avatar
Your_mom
Match Winner
Posts: 653
Joined: Sun Jun 06, 2004 1:45 am

Post by Your_mom »

anyone care to explain exactly how you change maps in game?
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: luke@dashjr.org

Post by Luke-Jr »

Your_mom wrote:anyone care to explain exactly how you change maps in game?
Either edit your user.cfg to set MAP_FILE to, for example, HexaTRON/0.4.1.xml (or whatever version is in there) or connect to a server with a different map (HexaTRON or CVS shaped_arenas test)
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

isnt there some console or menu commands to change the map? I'd like to know also how to change without reloading the game.

-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

Post by Luke-Jr »

philippeqc wrote:isnt there some console or menu commands to change the map? I'd like to know also how to change without reloading the game.
Eh? dunno... I don't use the console.
I suppose you could set the attributes from it, but you'd need to make sure MAP_URI is null
User avatar
Z-Man
God & Project Admin
Posts: 11736
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

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

Code: Select all

include map1.cfg
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.
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: luke@dashjr.org

Merged

Post by Luke-Jr »

shaped_arenas has been merged into HEAD.
The shaped_arenas branch is now considered deprecated and all changes should go into HEAD.
User avatar
Z-Man
God & Project Admin
Posts: 11736
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

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.
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: luke@dashjr.org

Post by Luke-Jr »

z-man wrote:Great! And it works out of the box.
That was part of the plan... but I'm not so sure if it does. :|
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...
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 haven't a clue what tASSERT does... I just assumed it's some debug thing that I can ignore.
z-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 it :) Sorry, I just tend to compile with maximal sensible warnings enabled and warnings as errors.
I did a bit of -Wall testing before merging and didn't notice it, but the fewer warnings, the better ;)
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.
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: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.
If a change is needed, feel free to change it ;)
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.
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

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 get the feeling this one is going to hover over my head for a long time ;)
z-man wrote:The code indeed was working fine under normal circumstances, but not for me with my picky development environment.
I see no reasons not to at least try to hold myself to your standard. Thanks for the pointers.

No problem at all with any of your changes. I should run more often with CXXFLAGS=" -ggdb -Wall" myself. Now I know about -DDEBUG.
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.
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.

-ph
Canis meus id comedit.
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

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.

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)
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 8)

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?
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

hmm, winzone (and deathzones) have stopped working.
User avatar
Lucifer
Project Developer
Posts: 8756
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

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
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

os x path problem: I'll let this into Luke's capable hand, as he also seem to have acces to a mac.
I really really wish xml2 and libpng had options to compile as a Framework for os x.
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?
but when I take a screenshot game crashes.
Same on linux and windows.
gj ;)
ty
edit: the rim walls are transparent, which is a little annoying. Was this a side effect or intended?
Side effect. But I've come to love it. It allow you to view what is lurking behind the bend of a wall.

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.
edit2: anyway to have a map, and not have to run a webserver to host it? shouldn't the game handle it?
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.

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

Post by Luke-Jr »

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.
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: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.
Maps should be loaded from (in this order):

Code: Select all

~/Library/Application Support/Armagetron/resource/
APP/Contents/Resources/resource/included
~/Library/Application Support/Armagetron/resource/automatic
nemostultae 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.
Screenshots crash here too. So far, I'm blaming it on the new PNG screenshots ;)
Take it to that thread, please.
nemostultae wrote:On the shaped arena test server, the rim wall textures on some walls are stretched (sorry, can't get a screenshot).
Known issue.
nemostultae wrote:edit: the rim walls are transparent, which is a little annoying. Was this a side effect or intended?
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:edit2: anyway to have a map, and not have to run a webserver to host it? shouldn't the game handle it?
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:hmm, winzone (and deathzones) have stopped working.
Known. =p
philippeqc wrote:os x path problem: I'll let this into Luke's capable hand, as he also seem to have acces to a mac.
I have access to an OSX filesystem. =p
The laptop is almost never running OSX itself, though, and we might be uninstalling it sometime soon.... unless there's use for it.
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.
Not really pride... I just like to keep my maps in the same place.
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...
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.
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.
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.
User avatar
Z-Man
God & Project Admin
Posts: 11736
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

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

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 manager
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 :oops: ) 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.
Post Reply