Auto-generating maps

For developmental things relating to the graphics of the game.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Auto-generating maps

Post by Jonathan »

I think this can result in quite interesting maps (not the spiral). To start off:

As an interface to the map format, I made some functions like:

Code: Select all

void axesbegin(FILE *fp, unsigned number) {
	fprintf(fp, "\t\t\t<Axes number=\"%u\" normalize=\"false\">\n", number);
}
Very simplistic, but usable.

This is one of the first maps I made with it, and to my knowledge the slowest map ever:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE World SYSTEM "map-0.1.dtd">
<World version="0.1">
	<Map name="Spiral" version="0.0" author="Jonathan">
		<Field>
			<Axes number="4" normalize="false">
				<Axis xdir="1" ydir="0"/>
				<Axis xdir="0" ydir="-1"/>
				<Axis xdir="-1" ydir="0"/>
				<Axis xdir="0" ydir="1"/>
			</Axes>
			<Spawn x="20" y="20" xdir="-1" ydir="0"/>
			<Wall>
				<Point x="0" y="0"/>
				<Point x="40" y="0"/>
				<Point x="40" y="40"/>
				<Point x="-40" y="40"/>
				<Point x="-40" y="-40"/>
				<Point x="80" y="-40"/>
				<Point x="80" y="80"/>
				<Point x="-80" y="80"/>
				<Point x="-80" y="-80"/>
				<Point x="120" y="-80"/>
				<Point x="120" y="120"/>
				<Point x="-120" y="120"/>
				<Point x="-120" y="-120"/>
				<Point x="160" y="-120"/>
				<Point x="160" y="160"/>
				<Point x="-160" y="160"/>
				<Point x="-160" y="-160"/>
				<Point x="200" y="-160"/>
				<Point x="200" y="200"/>
				<Point x="-200" y="200"/>
				<Point x="-200" y="-200"/>
				<Point x="240" y="-200"/>
				<Point x="240" y="240"/>
				<Point x="-240" y="240"/>
				<Point x="-240" y="-240"/>
				<Point x="280" y="-240"/>
				<Point x="280" y="280"/>
				<Point x="-280" y="280"/>
				<Point x="-280" y="-280"/>
				<Point x="320" y="-280"/>
				<Point x="320" y="320"/>
				<Point x="-320" y="320"/>
				<Point x="-320" y="-320"/>
				<Point x="360" y="-320"/>
				<Point x="360" y="360"/>
				<Point x="-360" y="360"/>
				<Point x="-360" y="-360"/>
				<Point x="400" y="-360"/>
				<Point x="400" y="400"/>
				<Point x="-400" y="400"/>
				<Point x="-400" y="-400"/>
				<Point x="440" y="-400"/>
				<Point x="440" y="440"/>
				<Point x="-440" y="440"/>
				<Point x="-440" y="-440"/>
				<Point x="480" y="-440"/>
				<Point x="480" y="480"/>
				<Point x="-480" y="480"/>
				<Point x="-480" y="-480"/>
				<Point x="520" y="-480"/>
				<Point x="520" y="520"/>
				<Point x="-520" y="520"/>
				<Point x="-520" y="-520"/>
				<Point x="560" y="-520"/>
				<Point x="560" y="560"/>
				<Point x="-560" y="560"/>
				<Point x="-560" y="-560"/>
				<Point x="600" y="-560"/>
				<Point x="600" y="600"/>
				<Point x="-600" y="600"/>
				<Point x="-600" y="-600"/>
				<Point x="640" y="-600"/>
				<Point x="640" y="640"/>
				<Point x="-640" y="640"/>
				<Point x="-640" y="-640"/>
				<Point x="680" y="-640"/>
				<Point x="680" y="680"/>
				<Point x="-680" y="680"/>
				<Point x="-680" y="-680"/>
				<Point x="720" y="-680"/>
				<Point x="720" y="720"/>
				<Point x="-720" y="720"/>
				<Point x="-720" y="-720"/>
				<Point x="760" y="-720"/>
				<Point x="760" y="760"/>
				<Point x="-760" y="760"/>
				<Point x="-760" y="-760"/>
				<Point x="800" y="-760"/>
				<Point x="800" y="800"/>
				<Point x="-800" y="800"/>
				<Point x="-800" y="-800"/>
				<Point x="840" y="-800"/>
				<Point x="840" y="840"/>
				<Point x="-840" y="840"/>
				<Point x="-840" y="-840"/>
				<Point x="880" y="-840"/>
				<Point x="880" y="880"/>
				<Point x="-880" y="880"/>
				<Point x="-880" y="-880"/>
				<Point x="920" y="-880"/>
				<Point x="920" y="920"/>
				<Point x="-920" y="920"/>
				<Point x="-920" y="-920"/>
				<Point x="960" y="-920"/>
				<Point x="960" y="960"/>
				<Point x="-960" y="960"/>
				<Point x="-960" y="-960"/>
				<Point x="1000" y="-960"/>
				<Point x="1000" y="1000"/>
				<Point x="-1000" y="1000"/>
				<Point x="-1000" y="-1000"/>
				<Point x="1040" y="-1000"/>
				<Point x="1040" y="1040"/>
				<Point x="-1040" y="1040"/>
				<Point x="-1040" y="-1040"/>
				<Point x="1080" y="-1040"/>
				<Point x="1080" y="1080"/>
				<Point x="-1080" y="1080"/>
				<Point x="-1080" y="-1080"/>
				<Point x="1120" y="-1080"/>
				<Point x="1120" y="1120"/>
				<Point x="-1120" y="1120"/>
				<Point x="-1120" y="-1120"/>
				<Point x="1160" y="-1120"/>
				<Point x="1160" y="1160"/>
				<Point x="-1160" y="1160"/>
				<Point x="-1160" y="-1160"/>
				<Point x="1200" y="-1160"/>
				<Point x="1200" y="1200"/>
				<Point x="-1200" y="1200"/>
				<Point x="-1200" y="-1200"/>
				<Point x="1240" y="-1200"/>
				<Point x="1240" y="1240"/>
				<Point x="-1240" y="1240"/>
				<Point x="-1240" y="-1240"/>
				<Point x="1280" y="-1240"/>
				<Point x="1280" y="1280"/>
				<Point x="-1280" y="1280"/>
				<Point x="-1280" y="-1280"/>
				<Point x="1320" y="-1280"/>
				<Point x="1320" y="1320"/>
				<Point x="-1320" y="1320"/>
				<Point x="-1320" y="-1320"/>
				<Point x="1360" y="-1320"/>
				<Point x="1360" y="1360"/>
				<Point x="-1360" y="1360"/>
				<Point x="-1360" y="-1360"/>
				<Point x="1400" y="-1360"/>
				<Point x="1400" y="1400"/>
				<Point x="-1400" y="1400"/>
				<Point x="-1400" y="-1400"/>
				<Point x="1440" y="-1400"/>
				<Point x="1440" y="1440"/>
				<Point x="-1440" y="1440"/>
				<Point x="-1440" y="-1440"/>
				<Point x="1480" y="-1440"/>
				<Point x="1480" y="1480"/>
				<Point x="-1480" y="1480"/>
				<Point x="-1480" y="-1480"/>
				<Point x="1520" y="-1480"/>
				<Point x="1520" y="1520"/>
				<Point x="-1520" y="1520"/>
				<Point x="-1520" y="-1520"/>
				<Point x="1560" y="-1520"/>
				<Point x="1560" y="1560"/>
				<Point x="-1560" y="1560"/>
				<Point x="-1560" y="-1560"/>
				<Point x="1600" y="-1560"/>
				<Point x="1600" y="1600"/>
				<Point x="-1600" y="1600"/>
				<Point x="-1600" y="-1600"/>
				<Point x="1640" y="-1600"/>
				<Point x="1640" y="1640"/>
				<Point x="-1640" y="1640"/>
				<Point x="-1640" y="-1640"/>
				<Point x="1680" y="-1640"/>
				<Point x="1680" y="1680"/>
				<Point x="-1680" y="1680"/>
				<Point x="-1680" y="-1680"/>
				<Point x="1720" y="-1680"/>
				<Point x="1720" y="1720"/>
				<Point x="-1720" y="1720"/>
				<Point x="-1720" y="-1720"/>
				<Point x="1760" y="-1720"/>
				<Point x="1760" y="1760"/>
				<Point x="-1760" y="1760"/>
				<Point x="-1760" y="-1760"/>
				<Point x="1800" y="-1760"/>
				<Point x="1800" y="1800"/>
				<Point x="-1800" y="1800"/>
				<Point x="-1800" y="-1800"/>
				<Point x="1840" y="-1800"/>
				<Point x="1840" y="1840"/>
				<Point x="-1840" y="1840"/>
				<Point x="-1840" y="-1840"/>
				<Point x="1880" y="-1840"/>
				<Point x="1880" y="1880"/>
				<Point x="-1880" y="1880"/>
				<Point x="-1880" y="-1880"/>
				<Point x="1920" y="-1880"/>
				<Point x="1920" y="1920"/>
				<Point x="-1920" y="1920"/>
				<Point x="-1920" y="-1920"/>
				<Point x="1960" y="-1920"/>
				<Point x="1960" y="1960"/>
				<Point x="-1960" y="1960"/>
				<Point x="-1960" y="-1960"/>
				<Point x="2000" y="-1960"/>
				<Point x="2000" y="2000"/>
				<Point x="-2000" y="2000"/>
				<Point x="-2000" y="-2000"/>
				<Point x="2040" y="-2000"/>
				<Point x="2040" y="2040"/>
				<Point x="-2040" y="2040"/>
				<Point x="-2040" y="-2040"/>
				<Point x="2080" y="-2040"/>
				<Point x="2080" y="2080"/>
				<Point x="-2080" y="2080"/>
				<Point x="-2080" y="-2080"/>
				<Point x="2120" y="-2080"/>
				<Point x="2120" y="2120"/>
				<Point x="-2120" y="2120"/>
				<Point x="-2120" y="-2120"/>
				<Point x="2160" y="-2120"/>
				<Point x="2160" y="2160"/>
				<Point x="-2160" y="2160"/>
				<Point x="-2160" y="-2160"/>
				<Point x="2200" y="-2160"/>
				<Point x="2200" y="2200"/>
				<Point x="-2200" y="2200"/>
				<Point x="-2200" y="-2200"/>
				<Point x="2240" y="-2200"/>
				<Point x="2240" y="2240"/>
				<Point x="-2240" y="2240"/>
				<Point x="-2240" y="-2240"/>
				<Point x="2280" y="-2240"/>
				<Point x="2280" y="2280"/>
				<Point x="-2280" y="2280"/>
				<Point x="-2280" y="-2280"/>
				<Point x="2320" y="-2280"/>
				<Point x="2320" y="2320"/>
				<Point x="-2320" y="2320"/>
				<Point x="-2320" y="-2320"/>
				<Point x="2360" y="-2320"/>
				<Point x="2360" y="2360"/>
				<Point x="-2360" y="2360"/>
				<Point x="-2360" y="-2360"/>
				<Point x="2400" y="-2360"/>
				<Point x="2400" y="2400"/>
				<Point x="-2400" y="2400"/>
				<Point x="-2400" y="-2400"/>
				<Point x="2440" y="-2400"/>
				<Point x="2440" y="2440"/>
				<Point x="-2440" y="2440"/>
				<Point x="-2440" y="-2440"/>
				<Point x="2480" y="-2440"/>
				<Point x="2480" y="2480"/>
				<Point x="-2480" y="2480"/>
				<Point x="-2480" y="-2480"/>
				<Point x="2520" y="-2480"/>
				<Point x="2520" y="2520"/>
				<Point x="-2520" y="2520"/>
				<Point x="-2520" y="-2520"/>
				<Point x="2560" y="-2520"/>
				<Point x="2560" y="2560"/>
				<Point x="-2560" y="2560"/>
				<Point x="-2560" y="-2560"/>
				<Point x="2600" y="-2560"/>
				<Point x="2600" y="2600"/>
				<Point x="-2600" y="2600"/>
				<Point x="-2600" y="-2600"/>
				<Point x="2640" y="-2600"/>
				<Point x="2640" y="2640"/>
				<Point x="-2640" y="2640"/>
				<Point x="-2640" y="-2640"/>
				<Point x="2680" y="-2640"/>
				<Point x="2680" y="2680"/>
				<Point x="-2680" y="2680"/>
				<Point x="-2680" y="-2680"/>
				<Point x="2720" y="-2680"/>
				<Point x="2720" y="2720"/>
				<Point x="-2720" y="2720"/>
				<Point x="-2720" y="-2720"/>
				<Point x="2760" y="-2720"/>
				<Point x="2760" y="2760"/>
				<Point x="-2760" y="2760"/>
				<Point x="-2760" y="-2760"/>
				<Point x="2800" y="-2760"/>
				<Point x="2800" y="2800"/>
				<Point x="-2800" y="2800"/>
				<Point x="-2800" y="-2800"/>
				<Point x="2840" y="-2800"/>
				<Point x="2840" y="2840"/>
				<Point x="-2840" y="2840"/>
				<Point x="-2840" y="-2840"/>
				<Point x="2880" y="-2840"/>
				<Point x="2880" y="2880"/>
				<Point x="-2880" y="2880"/>
				<Point x="-2880" y="-2880"/>
				<Point x="2920" y="-2880"/>
				<Point x="2920" y="2920"/>
				<Point x="-2920" y="2920"/>
				<Point x="-2920" y="-2920"/>
				<Point x="2960" y="-2920"/>
				<Point x="2960" y="2960"/>
				<Point x="-2960" y="2960"/>
				<Point x="-2960" y="-2960"/>
				<Point x="3000" y="-2960"/>
				<Point x="3000" y="3000"/>
				<Point x="-3000" y="3000"/>
				<Point x="-3000" y="-3000"/>
				<Point x="3040" y="-3000"/>
				<Point x="3040" y="3040"/>
				<Point x="-3040" y="3040"/>
				<Point x="-3040" y="-3040"/>
				<Point x="3080" y="-3040"/>
				<Point x="3080" y="3080"/>
				<Point x="-3080" y="3080"/>
				<Point x="-3080" y="-3080"/>
				<Point x="3120" y="-3080"/>
				<Point x="3120" y="3120"/>
				<Point x="-3120" y="3120"/>
				<Point x="-3120" y="-3120"/>
				<Point x="3160" y="-3120"/>
				<Point x="3160" y="3160"/>
				<Point x="-3160" y="3160"/>
				<Point x="-3160" y="-3160"/>
				<Point x="3200" y="-3160"/>
				<Point x="3200" y="3200"/>
				<Point x="-3200" y="3200"/>
				<Point x="-3200" y="-3200"/>
				<Point x="3240" y="-3200"/>
				<Point x="3240" y="3240"/>
				<Point x="-3240" y="3240"/>
				<Point x="-3240" y="-3240"/>
				<Point x="3280" y="-3240"/>
				<Point x="3280" y="3280"/>
				<Point x="-3280" y="3280"/>
				<Point x="-3280" y="-3280"/>
				<Point x="3320" y="-3280"/>
				<Point x="3320" y="3320"/>
				<Point x="-3320" y="3320"/>
				<Point x="-3320" y="-3320"/>
				<Point x="3360" y="-3320"/>
				<Point x="3360" y="3360"/>
				<Point x="-3360" y="3360"/>
				<Point x="-3360" y="-3360"/>
				<Point x="3400" y="-3360"/>
				<Point x="3400" y="3400"/>
				<Point x="-3400" y="3400"/>
				<Point x="-3400" y="-3400"/>
				<Point x="3440" y="-3400"/>
				<Point x="3440" y="3440"/>
				<Point x="-3440" y="3440"/>
				<Point x="-3440" y="-3440"/>
				<Point x="3480" y="-3440"/>
				<Point x="3480" y="3480"/>
				<Point x="-3480" y="3480"/>
				<Point x="-3480" y="-3480"/>
				<Point x="3520" y="-3480"/>
				<Point x="3520" y="3520"/>
				<Point x="-3520" y="3520"/>
				<Point x="-3520" y="-3520"/>
				<Point x="3560" y="-3520"/>
				<Point x="3560" y="3560"/>
				<Point x="-3560" y="3560"/>
				<Point x="-3560" y="-3560"/>
				<Point x="3600" y="-3560"/>
				<Point x="3600" y="3600"/>
				<Point x="-3600" y="3600"/>
				<Point x="-3600" y="-3600"/>
				<Point x="3640" y="-3600"/>
				<Point x="3640" y="3640"/>
				<Point x="-3640" y="3640"/>
				<Point x="-3640" y="-3640"/>
				<Point x="3680" y="-3640"/>
				<Point x="3680" y="3680"/>
				<Point x="-3680" y="3680"/>
				<Point x="-3680" y="-3680"/>
				<Point x="3720" y="-3680"/>
				<Point x="3720" y="3720"/>
				<Point x="-3720" y="3720"/>
				<Point x="-3720" y="-3720"/>
				<Point x="3760" y="-3720"/>
				<Point x="3760" y="3760"/>
				<Point x="-3760" y="3760"/>
				<Point x="-3760" y="-3760"/>
				<Point x="3800" y="-3760"/>
				<Point x="3800" y="3800"/>
				<Point x="-3800" y="3800"/>
				<Point x="-3800" y="-3800"/>
				<Point x="3840" y="-3800"/>
				<Point x="3840" y="3840"/>
				<Point x="-3840" y="3840"/>
				<Point x="-3840" y="-3840"/>
				<Point x="3880" y="-3840"/>
				<Point x="3880" y="3880"/>
				<Point x="-3880" y="3880"/>
				<Point x="-3880" y="-3880"/>
				<Point x="3920" y="-3880"/>
				<Point x="3920" y="3920"/>
				<Point x="-3920" y="3920"/>
				<Point x="-3920" y="-3920"/>
				<Point x="3960" y="-3920"/>
				<Point x="3960" y="3960"/>
				<Point x="-3960" y="3960"/>
				<Point x="-3960" y="-3960"/>
				<Point x="4000" y="-3960"/>
				<Point x="4000" y="4000"/>
				<Point x="-4000" y="4000"/>
				<Point x="-4000" y="-4000"/>
			</Wall>
		</Field>
	</Map>
</World>
It's possible to escape, but that'll take a while. :)

Your turn!
ˌɑrməˈɡɛˌtrɑn
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Very neat Jonathan!

I've read over it, and I wonder, how many loop are there? Seeing that its increments of 40, and it ends at 4000, I'd say about 100 loops. Unless you've hidden some other loops in it!!!!

As for fps killer, I think you'd win over the castle map. Might I suggest something that could give back a bit of performance:

...
<!DOCTYPE World SYSTEM "map-0.1-exp.dtd">
...
<ObstacleWall>
<Point x="0" y="0"/>
<Point x="40" y="0"/>
...
<Point x="-3960" y="3960"/>
<Point x="-3960" y="-3960"/>
</ObstacleWall>
<Wall>
<Point x="-3960" y="-3960"/>
<Point x="4000" y="-3960"/>
<Point x="4000" y="4000"/>
<Point x="-4000" y="4000"/>
<Point x="-4000" y="-4000"/>
</Wall>

Observe that the last point of ObstacleWall is shared with Wall.

By using ObstacleWall instead of wall, you reduce the amount of filling the graphic card need to do (well, that depend the local rim setting too, but generally speaking).

As for automated map generation, I have a bash script at home that generates a "roulette" map. Not the greatest thing since sliced bread! Maybe it will inspire someone else. I'll try to locate it and post it tonight.

-ph
Canis meus id comedit.
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Here is the script I've mentionned.

In the begining I have defined some variable. They should be documented enought to allow you to graps their intent.

One quick improment would be to change all the "Wall" inside the loop to "ObstacleWall" (and set the dtd to map-0.1.dtd).


(quick mistake found:
ir_f=20 # divided by 10, so 1.5
should read
ir_f=20 # divided by 10, so 2.0
I didnt find any good way to input floats, so instead I give integers and I divide them by 10.)

-ph

edit: removed a part and put it in the smae discusssion than the tutorial
Attachments
roulette2.zip
bash script to generate a roulette map
(962 Bytes) Downloaded 574 times
roulette2.zip
The bash script that generates a roulette
(962 Bytes) Downloaded 557 times
Canis meus id comedit.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

I wasn't yet trying to generate a map that's fun to play. I just barely had the stuff running without breaking the dtd (got some typo-like errors before).

At the moment I'm trying to code better map generation code.
ˌɑrməˈɡɛˌtrɑn
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Oups, it wasn't meant as a critisism. (the part that was edited out and changed in the tutorial discussion).

You generated a "mission" map, ie: escape the spiral (*). It opened my mind to that new possibility, and I remembered the article. I never thought that article would be applicable to AA when I read it.

Now that it seems that map designer (or generator designer ;) ) want to make "mission" maps, I'll have to work hard to provide capacity for it.

-ph


(*)Well, Your_mom did it before.
Canis meus id comedit.
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Well if you have a pathway to follow, what's to stop someone doing a horizontal wall across the entire pathway to block others following?
Image
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Jonathan, let me start again.

*takes a deep breath*

A map generator. Wow! You mean "something that I feed some criteria, and it output a map". Neat! I've already got burned doing lots of cut-and-paste, search-and-replace to do the castle map. Any tool that can simplify that job is welcomed

*this is where, like a good forum poster, I totally launch in fabulation*
If it is in your plan to support "higher language capacity" (ie: any keyword that is convenient to use to quickly describe a map), it would really be great. The parser development could focus on exposing core functionnality, and your generator offer an easy and convenient interface to describe very complex maps.

In any case, you really picked my curiosity. Care to do us a small sales-pitch/teaser presentation of your plans? 'Cause I'm already buying!

-ph
Canis meus id comedit.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

I don't have any big plans, but at the moment I'm trying to do something with growing arrays (so you don't need to add ObstacleWalls after Walls, for example) and C++ (which I don't have much experience with - most time is spent experimenting there).
philippeqc wrote:Oups, it wasn't meant as a critisism. (the part that was edited out and changed in the tutorial discussion).
No problem. What you said is valid. I only gave the reason why I didn't do it.
You generated a "mission" map, ie: escape the spiral (*). It opened my mind to that new possibility, and I remembered the article. I never thought that article would be applicable to AA when I read it.
Actually a lot of randomness comes from the players. The original map is a simple square, yet fun.
ˌɑrməˈɡɛˌtrɑn
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Jonathan wrote:(so you don't need to add ObstacleWalls after Walls, for example)
Yeah, I never had probs with the order of elements in the map till the ObstacleWall came. If anyone know how to specify the dtd to allow out of order items, it would be neat. But I will probably not do much than simple touch up to the dtd about this problem as a) OW will most probably be merged back into Wall at the next version b) just this weekend, while I was fooling with new ideas for Bacchus, I forgot a '"' (double quote) after a parameter. dtd validation popped it up in .05 second, but should I have made my own input validation code, I'd still be looking for the source of the error, and blame the code I was testing.

You mentionned something about growing arrays. Care to develop on that?

Your idea of generator really look interesting, and you picked my curiosity good too.

-ph
Canis meus id comedit.
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

philippeqc wrote:You mentionned something about growing arrays. Care to develop on that?
Something like tArray, to hold stuff before it is written to disk in the right order.
ˌɑrməˈɡɛˌtrɑn
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

I think I'll go for Java à la Robocode. :)
ˌɑrməˈɡɛˌtrɑn
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

I am working on a maze generator in Ruby. I came across this, and it is very helpful.

Here are a few examples in C, and some more general docs.
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: luke@dashjr.org

Post by Luke-Jr »

And here's some stuff I made a while ago for HexaTRON and adapted to make 40-gon...
Attachments
griddraw-20050811.tar.bz2
griddraw!
(27.51 KiB) Downloaded 573 times
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Mazes are going to be fun. :)
ˌɑrməˈɡɛˌtrɑn
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Got that Java thing working. :D

It includes some fun spawn stuff (for it to work ensure speed multiplier == size multiplier):

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE World SYSTEM "map-0.1-exp.dtd">
<World version="0.1">
	<Map name="Spiral" version="0.0" author="Jonathan">
		<Field>
			<Spawn x="20.0" y="20.0" xdir="-1.0" ydir="0.0"/>
			<Wall>
				<Point x="0.0" y="0.0"/>
				<Point x="40.0" y="0.0"/>
				<Point x="40.0" y="40.0"/>
				<Point x="-40.0" y="40.0"/>
				<Point x="-40.0" y="-40.0"/>
				<Point x="80.0" y="-40.0"/>
				<Point x="80.0" y="80.0"/>
				<Point x="-80.0" y="80.0"/>
				<Point x="-80.0" y="-80.0"/>
				<Point x="120.0" y="-80.0"/>
				<Point x="120.0" y="120.0"/>
				<Point x="-120.0" y="120.0"/>
				<Point x="-120.0" y="-120.0"/>
				<Point x="160.0" y="-120.0"/>
				<Point x="160.0" y="160.0"/>
				<Point x="-160.0" y="160.0"/>
				<Point x="-160.0" y="-160.0"/>
				<Point x="200.0" y="-160.0"/>
				<Point x="200.0" y="200.0"/>
				<Point x="-200.0" y="200.0"/>
				<Point x="-200.0" y="-200.0"/>
				<Point x="240.0" y="-200.0"/>
				<Point x="240.0" y="240.0"/>
				<Point x="-240.0" y="240.0"/>
				<Point x="-240.0" y="-240.0"/>
				<Point x="280.0" y="-240.0"/>
				<Point x="280.0" y="280.0"/>
				<Point x="-280.0" y="280.0"/>
				<Point x="-280.0" y="-280.0"/>
				<Point x="320.0" y="-280.0"/>
				<Point x="320.0" y="320.0"/>
				<Point x="-320.0" y="320.0"/>
				<Point x="-320.0" y="-320.0"/>
				<Point x="360.0" y="-320.0"/>
				<Point x="360.0" y="360.0"/>
				<Point x="-360.0" y="360.0"/>
				<Point x="-360.0" y="-360.0"/>
				<Point x="400.0" y="-360.0"/>
				<Point x="400.0" y="400.0"/>
				<Point x="-400.0" y="400.0"/>
				<Point x="-400.0" y="-400.0"/>
			</Wall>
			<ObstacleWall height="1.0">
				<Point x="21.0" y="21.0"/>
				<Point x="19.0" y="21.0"/>
				<Point x="19.0" y="19.0"/>
				<Point x="21.0" y="19.0"/>
				<Point x="21.0" y="21.0"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="23.202896" y="18.24638"/>
				<Point x="21.202896" y="18.24638"/>
				<Point x="21.202896" y="16.24638"/>
				<Point x="23.202896" y="16.24638"/>
				<Point x="23.202896" y="18.24638"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="23.202896" y="23.75362"/>
				<Point x="21.202896" y="23.75362"/>
				<Point x="21.202896" y="21.75362"/>
				<Point x="23.202896" y="21.75362"/>
				<Point x="23.202896" y="23.75362"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="25.405791999999998" y="15.49276"/>
				<Point x="23.405791999999998" y="15.49276"/>
				<Point x="23.405791999999998" y="13.49276"/>
				<Point x="25.405791999999998" y="13.49276"/>
				<Point x="25.405791999999998" y="15.49276"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="25.405791999999998" y="26.50724"/>
				<Point x="23.405791999999998" y="26.50724"/>
				<Point x="23.405791999999998" y="24.50724"/>
				<Point x="25.405791999999998" y="24.50724"/>
				<Point x="25.405791999999998" y="26.50724"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="27.608688" y="12.739139999999999"/>
				<Point x="25.608688" y="12.739139999999999"/>
				<Point x="25.608688" y="10.739139999999999"/>
				<Point x="27.608688" y="10.739139999999999"/>
				<Point x="27.608688" y="12.739139999999999"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="27.608688" y="29.26086"/>
				<Point x="25.608688" y="29.26086"/>
				<Point x="25.608688" y="27.26086"/>
				<Point x="27.608688" y="27.26086"/>
				<Point x="27.608688" y="29.26086"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="29.811584" y="9.98552"/>
				<Point x="27.811584" y="9.98552"/>
				<Point x="27.811584" y="7.985519999999999"/>
				<Point x="29.811584" y="7.985519999999999"/>
				<Point x="29.811584" y="9.98552"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="29.811584" y="32.01448"/>
				<Point x="27.811584" y="32.01448"/>
				<Point x="27.811584" y="30.01448"/>
				<Point x="29.811584" y="30.01448"/>
				<Point x="29.811584" y="32.01448"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="32.01448" y="7.2318999999999996"/>
				<Point x="30.01448" y="7.2318999999999996"/>
				<Point x="30.01448" y="5.2318999999999996"/>
				<Point x="32.01448" y="5.2318999999999996"/>
				<Point x="32.01448" y="7.2318999999999996"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="32.01448" y="34.768100000000004"/>
				<Point x="30.01448" y="34.768100000000004"/>
				<Point x="30.01448" y="32.768100000000004"/>
				<Point x="32.01448" y="32.768100000000004"/>
				<Point x="32.01448" y="34.768100000000004"/>
			</ObstacleWall>
			<ObstacleWall height="1.0">
				<Point x="34.217376" y="4.478279999999998"/>
				<Point x="32.217376" y="4.478279999999998"/>
				<Point x="32.217376" y="2.478279999999998"/>
				<Point x="34.217376" y="2.478279999999998"/>
				<Point x="34.217376" y="4.478279999999998"/>
			</ObstacleWall>
		</Field>
	</Map>
</World>
Try it with 11 bots.
ˌɑrməˈɡɛˌtrɑn
Post Reply