How to change a map on the fly?

Designed a level that creates new, exciting, and challenging Armagetron game play? Or maybe just something funky. Put it right here.
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Lotsa stuff, I hope i dont forget anything...

Ok, GAME_TIMEOUT... I was already looking for something like that, thanks :)
I have special obstacles at the sides now... i hope u like em ;)

I already tried disabling rubber, but it's half as fun... I'd have to make it slower ;)

I think the messages must be serverside... take icemans server, it has a custom one... And the messages dont change if I change the language on the client... wow would it be called anyways? "Sofortige Todeszone"? ROFL.

Ok, i set up apache to send deflated files, it looks like it works.

I have one bottlehole in the middle now, in 50% of all cases i die there ;)

I already thought about passageways, but i didnt find out how to make them yet and the camera will go crazy...

I also added special obstacles that only appear on the rim... c 4 urself ;) And there are some obstacles with infnite height...

I never got a change to play on the crack pipe, so i dont know how it looks like... can u send me one of the generated mazes?

I have no problem with phyton... exept that i dont know any more about it than 99 bottles of beer ;) So i would prefer php.

Do we really need to hack the server? The current version is simple and works pretty well... u can even define if u want a new maze every round, every 5 rounds or every match etc...

And yeah, i know those ppl... one time one of them even insulted me and my server when i set the rubber down because it causes so many bugs... now he's fine and plays on both servers ;)
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

The Crack Pipe didn't have generated maps, it had player contributed maps (and a couple I made). I'll be bringing it back up in a bit, I'd like to bring it up as a fortress server, though, and none of the maps I have for it are fortress maps. :(

The maze generator was used on the Labyrinth, which is a server that's not likely to reappear, but I'm very interested in generated maps. ;) Anyway, I think a path to generating passageways is through adapting the maze generator I wrote, because that's all it does, it generates passageways. :) I'll beat on it when I'm less sleepy.

So we'll do php, I'll see about how I can work in the maze generator. It's got some bugs in python that I never managed to find, but translating it to php is likely to do something on them. :) It also gives me an opportunity to rethink the generation algorithm, it uses a pretty basic algorithm right now and could use some improvement.

The reason for hacking the server is my own laziness, surprisingly enough. I don't want to have to deal with turning that shell script into a daemon that starts when the system starts, you know, init.d and all that stuff. My server is also a desktop computer that my wife needs to use, so I have to run the game server as a daemon. Which reminds me, I really need to get the master server that's on it turned into a daemon. Heh.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Why won't u bring the maze server back up? i already thought about scripting my own one ;)

Ok, good luck porting your maze script, go get some sleep!

Oh well, i have no reason to make the arma servers daemons... my server is running 24/7 under linux (it had an uptime of 114 days... and then a power black- out that killed it :( ).
Currently i have the servers and the script in a screen session which works pretty well... if i lose connection i just reconnect and say screen -r... simple ;) for me it wouldn't be worth the effort to dig into code i didnt write (and i dont know too much about c, either... just theory, never had a big project)
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Ok, here's the newest version of my script:

Code: Select all

#!/usr/bin/php
<?='<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>'?>

<!DOCTYPE Resource SYSTEM "map-0.2.8_beta3.dtd">

<Resource type="aamap" name="Racing maze" version="0.2" author="wrtlprnft" category="OktaTRON">

<Map version="0.2.8">
    <Settings>
        <Setting name="TEAMS_MIN" value="2" />
        <Setting name="TEAMS_MAX" value="9" />
        <Setting name="SP_TEAMS_MIN" value="2" />
        <Setting name="SP_TEAMS_MAX" value="10" />
    </Settings>
<World>
    <Field>
        <Axes number="8" />
<?php
        define('HEIGHT', 2500);
        define('WIDTH', 100);
        define('SPAWNPOINTS', 18);
        define('NUMOBJECTS', 300);
        define('MAXTRIES', 80);


        $OBJECTS = array(
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 3, 'POINTS' => array(array('X' => -10, 'Y' => 0), array('X' => 10, 'Y' => 0))),
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => 0, 'Y' => -10), array('X' => 0, 'Y' => 10), array('X' => -10, 'Y' => 10), array('X' => 10, 'Y' => 10))),
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => -10, 'Y' => -5), array('X' => -8, 'Y' => 5), array('X' => 8, 'Y' => 5), array('X' => 10, 'Y' => -5))),
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => -10, 'Y' => -5), array('X' => -5, 'Y' => 5), array('X' => 0, 'Y' => -5), array('X' => 5, 'Y' => 5), array('X' => 10, 'Y' => -5))),
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => -2, 'Y' => -4), array('X' => 2, 'Y' => -4), array('X' => -4, 'Y' => -2), array('X' => 4, 'Y' => -2), array('X' => -6, 'Y' => 0), array('X' => 6, 'Y' => 0), array('X' => -8, 'Y' => 2), array('X' => -8, 'Y' => 2), array('X' => -10, 'Y' => 4), array('X' => 10, 'Y' => 4))),
            array('TYPE' => 0, 'MINDISTANCE' => 10, 'RIMDISTANCE' => 5, 'POINTS' => array(array('X' => -5, 'Y' => -4), array('X' => -4, 'Y' => -5), array('X' => 4, 'Y' => -5), array('X' => 5, 'Y' => -4), array('X' => 5, 'Y' => -1), array('X' => 4, 'Y' => 0), array('X' => -4, 'Y' => 0), array('X' => -5, 'Y' => 1), array('X' => -5, 'Y' => 4), array('X' => -4, 'Y' => 5), array('X' => 4, 'Y' => 5), array('X' => 5, 'Y' => 4))),
            array('TXPE' => 0, 'MINDISTANYE' => 10, 'RIMDISTANYE' => 5, 'POINTS' => array(array('Y' => -5, 'X' => -4), array('Y' => -4, 'X' => -5), array('Y' => 4, 'X' => -5), array('Y' => 5, 'X' => -4), array('Y' => 5, 'X' => -1), array('Y' => 4, 'X' => 0), array('Y' => -4, 'X' => 0), array('Y' => -5, 'X' => 1), array('Y' => -5, 'X' => 4), array('Y' => -4, 'X' => 5), array('Y' => 4, 'X' => 5), array('Y' => 5, 'X' => 4))),
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => -8, 'Y' => -5), array('X' => -10, 'Y' => 5), array('X' => 10, 'Y' => 5), array('X' => 8, 'Y' => -5))),
            array('TYPE' => 0, 'MINDISTANCE' => 23, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => 0, 'Y' => -20), array('X' => 0, 'Y' => 20), array('X' => -10, 'Y' => 10), array('X' => 10, 'Y' => 10))),
            array('TYPE' => 0, 'MINDISTANCE' => 20, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => 10, 'Y' => 20), array('X' => 0, 'Y' => 0), array('X' => 10, 'Y' => 0), array('X' => 0, 'Y' => 20), array('X' => 10, 'Y' => 20))),
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 3, 'POINTS' => array(array('X' => 0, 'Y' => 10), array('X' => 0, 'Y' => -10))),
            array('TYPE' => 0, 'HEIGHT' => -1, 'SIDE' => 'r', 'MINDISTANCE' => 4, 'POINTS' => array(array('X' => -2, 'Y' => 2), array('X' => 0, 'Y' => 0))),
            array('TYPE' => 0, 'HEIGHT' => -1, 'SIDE' => 'r', 'MINDISTANCE' => 4, 'POINTS' => array(array('X' => -2, 'Y' => -2), array('X' => 0, 'Y' => 0))),
            array('TYPE' => 0, 'HEIGHT' => -1, 'SIDE' => 'l', 'MINDISTANCE' => 4, 'POINTS' => array(array('X' => 3, 'Y' => 3), array('X' => 0, 'Y' => 0))),
            array('TYPE' => 0, 'HEIGHT' => -1, 'SIDE' => 'l', 'MINDISTANCE' => 4, 'POINTS' => array(array('X' => 3, 'Y' => -3), array('X' => 0, 'Y' => 0))),
            array('TYPE' => 0, 'HEIGHT' => -1, 'RIMDISTANCE' => '2', 'MINDISTANCE' => 4, 'POINTS' => array(array('X' => 2, 'Y' => 0), array('X' => 0, 'Y' => 2), array('X' => -2, 'Y' => 0), array('X' => 0, 'Y' => -2), array('X' => 2, 'Y' => 0))),
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 6, 'POINTS' => array(array('X' => -10, 'Y' => -10), array('X' => 10, 'Y' => 10))),
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 6, 'POINTS' => array(array('X' => 10, 'Y' => -10), array('X' => -10, 'Y' => 10))),
            array('TYPE' => 0, 'MINDISTANCE' => 15, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => -10, 'Y' => 0), array('X' => 0, 'Y' => -10), array('X' => 10, 'Y' => 0))),
            array('TYPE' => 0, 'MINDISTANCE' => 20, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => -10, 'Y' => -5), array('X' => 0, 'Y' => 5), array('X' => 10, 'Y' => -5))),
            array('TYPE' => 0, 'MINDISTANCE' => 20, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => 10, 'Y' => 5), array('X' => 0, 'Y' => -5), array('X' => -10, 'Y' => 5))),
            array('TYPE' => 0, 'MINDISTANCE' => 20, 'RIMDISTANCE' => 10, 'POINTS' => array(array('X' => 10, 'Y' => -10), array('X' => 0, 'Y' => 10), array('X' => -10, 'Y' => -10))),
            array('TYPE' => 1, 'MINDISTANCE' => 20, 'RIMDISTANCE' => 1, 'r' => 7),
            array('TYPE' => 1, 'MINDISTANCE' => 20, 'RIMDISTANCE' => 1, 'r' => 5),
            array('TYPE' => 1, 'MINDISTANCE' => 20, 'RIMDISTANCE' => 1, 'r' => 10),
            array('TYPE' => 1, 'MINDISTANCE' => 40, 'RIMDISTANCE' => 1, 'r' => 20)
            //array('MINDISTANCE' => 8, 'RIMDISTANCE' => 3, 'POINTS' => array(array('X' => 5, 'Y' => 5), array('X' => 0, 'Y' => 5), array('X' => 0, 'Y' => 0), array('X' => 5, 'Y' => 0)), array('X' => 5, 'Y' => 5))
        );

        $usedobjs = array();

        for($i=0; $i<NUMOBJECTS; $i++)
        {
            $nextid = rand(0, count($OBJECTS) -1);
            $nextobj = $OBJECTS[$nextid];
            for($t=0; $t<MAXTRIES; $t++)
            {
                $newy=rand(100, HEIGHT);
                if($newy < HEIGHT/2-300 || $newy > HEIGHT/2+100)
                {
                    if($nextobj['SIDE'] == 'r')
                        $newx = WIDTH;
                    elseif($nextobj['SIDE'] == 'l')
                        $newx = 0;
                    else
                        $newx=rand($nextobj['RIMDISTANCE'] -1, WIDTH - $nextobj['RIMDISTANCE']+2);
                }
                else
                {
                    if($nextobj['SIDE'] == 'r') continue;
                    else if($nextobj['SIDE'] == 'l') continue;
                    else
                    if ($newx < HEIGHT/2-125)
                        $newx=rand($nextobj['RIMDISTANCE'] -26, WIDTH - $nextobj['RIMDISTANCE']+28);
                    else
                        $newx=rand($nextobj['RIMDISTANCE'] +24, WIDTH - $nextobj['RIMDISTANCE']-22);
                }
                $dist = $nextobj['MINDISTANCE'];
                $found=false;
                foreach($usedobjs as $obj)
                {
                    $olddist = $OBJECTS[$obj['id']]['MINDISTANCE'];
                    $totaldist = $olddist + $dist;
                    $xdiff = $newx - $obj['x'];
                    $ydiff = $newy - $obj['y'];
                    if(sqrt($xdiff*$xdiff + $ydiff*$ydiff) < $totaldist)
                    {
                        $found=true;
                        break;
                    }
                }
                if(!$found)
                {
                    $usedobjs[] = array('x' => $newx, 'y' => $newy, 'id' => $nextid);
                    break;
                }
            }
            if($t==MAXTRIES) break;
        }

?>
        <Spawn x="50" y="-50" angle="90" />
        <Spawn x="40" y="-50" angle="90" />
        <Spawn x="60" y="-50" angle="90" />
        <Spawn x="30" y="-50" angle="90" />
        <Spawn x="70" y="-50" angle="90" />
        <Spawn x="20" y="-50" angle="90" />
        <Spawn x="80" y="-50" angle="90" />
        <Spawn x="10" y="-50" angle="90" />
        <Spawn x="90" y="-50" angle="90" />
        <Zone effect="win">
            <ShapeCircle radius="100" growth="0">
                <Point x="<?=WIDTH/2?>" y="<?=HEIGHT+100?>" />
            </ShapeCircle>
        </Zone>
        <Zone effect="death">
            <ShapeCircle radius="1" growth="95">
                <Point x="<?=WIDTH/2?>" y="-199" />
            </ShapeCircle>
        </Zone>
        <Wall height="1">
            <Point x="10" y="-120" />
            <Point x="10" y="-60" />
            <Point x="15" y="-60" />
            <Point x="20" y="-65" />
            <Point x="20" y="-80" />
            <Point x="15" y="-85" />
            <Point x="10" y="-85" />
            <Point x="20" y="-120" />
        </Wall>
        <Wall height="1">
            <Point x="25" y="-120" />
            <Point x="40" y="-60" />
            <Point x="55" y="-120" />
            <Point x="47.5" y="-90" />
            <Point x="32.5" y="-90" />
        </Wall>
        <Wall height="1">
            <Point x="75" y="-65" />
            <Point x="70" y="-60" />
            <Point x="65" y="-60" />
            <Point x="60" y="-65" />
            <Point x="60" y="-115" />
            <Point x="65" y="-120" />
            <Point x="70" y="-120" />
            <Point x="75" y="-115" />
        </Wall>
        <Wall height="1">
            <Point x="95" y="-60" />
            <Point x="80" y="-60" />
            <Point x="80" y="-90" />
            <Point x="90" y="-90" />
            <Point x="80" y="-90" />
            <Point x="80" y="-120" />
            <Point x="95" y="-120" />
        </Wall>
        <Wall>
            <Point x="<?=WIDTH/2?>" y="<?=HEIGHT/2 -125?>" />
            <Point x="<?=WIDTH/2+5?>" y="<?=HEIGHT/2 -130?>" />
            <Point x="<?=WIDTH/2+5?>" y="<?=HEIGHT/2 -270?>" />
            <Point x="<?=WIDTH/2?>" y="<?=HEIGHT/2 -275?>" />
            <Point x="<?=WIDTH/2-5?>" y="<?=HEIGHT/2 -270?>" />
            <Point x="<?=WIDTH/2-5?>" y="<?=HEIGHT/2 -130?>" />
            <Point x="<?=WIDTH/2?>" y="<?=HEIGHT/2 -125?>" />
        </Wall>
        <Wall>
            <Point x="0"            y="-200"           />
            <Point x="<?=WIDTH?>"          y="-200"           />
            <Point x="<?=WIDTH?>"          y="<?=HEIGHT/2 - 300?>"       />
            <Point x="<?=WIDTH+25?>"          y="<?=HEIGHT/2 - 275?>"       />
            <Point x="<?=WIDTH+25?>"          y="<?=HEIGHT/2 - 125?>"       />
            <Point x="<?=WIDTH-25?>"          y="<?=HEIGHT/2 - 75?>"       />
            <Point x="<?=WIDTH-25?>"          y="<?=HEIGHT/2 + 75?>"       />
            <Point x="<?=WIDTH?>"          y="<?=HEIGHT/2 + 100?>"       />
            <Point x="<?=WIDTH?>"          y="<?=HEIGHT*20?>"       />
            <Point x="0"            y="<?=HEIGHT*20?>"       />
            <Point x="0"          y="<?=HEIGHT/2 + 100?>"       />
            <Point x="25"          y="<?=HEIGHT/2 + 75?>"       />
            <Point x="25"          y="<?=HEIGHT/2 - 75?>"       />
            <Point x="-25"          y="<?=HEIGHT/2 - 125?>"       />
            <Point x="-25"          y="<?=HEIGHT/2 - 275?>"       />
            <Point x="0"          y="<?=HEIGHT/2 - 300?>"       />
            <Point x="0"            y="-200"           />
        </Wall>
<?php
        foreach($usedobjs as $obj)
        {
            switch($OBJECTS[$obj['id']]['TYPE'])
            {
            case 0:
                $height = $OBJECTS[$obj['id']]['HEIGHT'];
                if (!$height)
                    $height = 2;
                if($height >= 0)
                    $str = ' height="' . $height . '"';
                else
                    $str = '';
                print('<Wall' . $str . '>');
                foreach($OBJECTS[$obj['id']]['POINTS'] as $point)
                    print('<Point x="' . ($obj['x'] + $point['X']) . '" y="' . ($obj['y'] + $point['Y']) . '" />');
                print('</Wall>' . "\n");
            break;
            case 1:
                print('<Zone effect="death"><ShapeCircle radius="' . $OBJECTS[$obj['id']]['r'] . '" growth="0"><Point x="' . $obj['x'] . '" y="' . $obj['y'] . '" /></ShapeCircle></Zone>
                ');
            }
        }
?>
    </Field>
</World>
</Map>
</Resource>
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

wrtlprnft wrote:I have special obstacles at the sides now... i hope u like em ;)
They're mean :)
wrtlprnft wrote:I think the messages must be serverside...
I think it's just Todeszone. You're right, the message is serverside. I moved it so it only appears for the "will this round never end?" zones. You can try to stop the annoyance by editing english_base.txt and deleting the text (not the whole line), especially the \n at the end.
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

I just opened a new server :)
Its called "maze test server" (the name will change) and featues a hexatron maze generator... look for urself. I'm planning to spread some random obstacles around it which should make it harder.

But another question: all those walls extremely slow down performance... currently im using a <Wall><Point /><Point /></Wall> construct for every wall u can see... would it make the game signifcantly faster if added an algorythm that puts adjacent walls together to one wall with more points? I'm not gonna write that if i dont know for sure if it'll help ;)
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

Merging the walls won't have any effect (apart from more correct texture coordinates), but randomizing their order in the map helps the engine get organized.
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

Just in case you want to make the game more race-like and less twitchy: lower the amount of available boost, either the acceleration value or the supply. Then, players have to avoid turning (takes speed) and need to manage the supply. This should give more even head-to-head races that are uncommon now.

Also, you may want to make rubber more effective at higher speeds. Increasing CYCLE_RUBBER_TIMEBASED from 0 to .5 should do the trick. 1 would probably be too much. Also, CYCLE_DELAY_TIMEBASED can be increased to give the cycles a bigger turn radius the faster they go.

And lastly, maybe you should experiment with big values of CYCLE_RUBBER_MINDISTANCE_RESERVOIR, something around .1 to 1. Currently, you get stuck pretty badly in the A's and M's, and this kind of mindistance should give you room to turn into both directions.

Feature requests, all included in Philippe's zone specs: I want zones that slow the first player who hits them down. Call them pedestrians if you like :twisted: I want the finish zone to have configurable score and effect: I want it to kill the player who enters. Then, you can cascade the win zones so the second finisher gets some points, too. I want the death zones to move across the race track :)
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

My current custom camera settings that made my play on the race server 100X better:

Code: Select all

camera_custom_turn_speed .3
camera_custom_turn_speed_180 24
camera_custom_back 2
camera_custom_rise 4
camera_custom_back_fromspeed .10
camera_custom_rise_fromspeed .10
camera_custom_pitch -1.3
camera_custom_zoom .4
And 120 degrees FOV. Increase *back* and *rise* accordingly if you prefer lower FOV.

Unfortunately, the most important part is the low turn speed that does not have an own setting for the server custom camera. When I did this I figured that the server should have no say in how fast the camera turns, just where it is positioned. I'll fix this for 0.2.8 final.
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

So, I factored your script into something a bit more OOP, and got it mostly working again that way. Problem, though. :) How does your spacing algorithm work? I'm trying to create a bounding box around each object and then check for overlap, nd that way I'm only getting one obstacle on the map. Heh.

Anyway, I'd like to make it support areas and connecting areas, then it could generate a course, and even vary the obstacles by area. That would be neat. :) Have a race that takes like 20 minutes to finish. (Don't know if that would be fun on an internet server, but for single play it would be fun)
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Hehe i know i have the habit to use arrays for everything... i dont really like messing around with classes ;)

At the moment, each object template has the parameters mindistance and rimdistance... rimdistance is the minimum distance from the outer wall and mindistance is the minimal distance to another object (they get added together)...

then the script chooses a random y value, calculates a random x value that lies in the boundaries of rimdistance and checks if this position conflicts with any already placed object... if it doesn't, it gets added to the list of used objects, if it does it generates new x and y values and try again until it hits a maximum number of tries...
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Yeah, for a race track generator like what you've got, classes are probably a bit of overkill. Not completely, putting it all into one single class would make it easier to do things like embed it in a webpage, or use it in a hypothetical map editor, or something like that.

Ahh, but the advantages kick in when you want to generate more complex maps with it. The idea with areas is that an area can be empty, it can have obstacles in it (like what you've already written), it can have a maze in it, or whatever. Then you chain several areas together and you can make complete courses, or you could build a room-oriented dungeon sorta thing. When maps are really three dimensional, then it could generate three dimensional mazes. The other thing, in this setup I've been factoring your code into, each GridObject derives from a base class and stores its points in the same place. So we can rotate, scale, and otherwise transform each object, provided it respects those interfaces, which most should, and all of yours will already. But more complex objects can be built on top of existing objects. :)

I've attached the code, maybe someone can make sense of it. If not, I'll poke it later on, I've got to go to a birthday dinner tonight. The Arena class has a Overlaps method that takes a GridObject for its argument, iterates through its list of GridObjects, and calls each GridObject's own Overlap method with the GridObject passed in as the argument.
Attachments
racerzip.tar.gz
(5.36 KiB) Downloaded 383 times
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Nice work, I'm thinking what i could do with it... maybe ill integrate it into my hexamaze server so i can sprinkle some obstacles there...
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

By the way, the wiki seems to be down again... i wanted to make a new entry about how to make maps changing automatically, many ppl asked me how...

Edit: btw, bug report: after a while of playing on my server, the walls get all messed up... Screenshot (another one, but looks funnier)...

Could it have to do with the long walls on the sides? maybe theres a counter or something for the texture offset and it overflows somehow?
Last edited by wrtlprnft on Sat Jan 07, 2006 6:57 am, edited 1 time in total.
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Um, except it doesn't work, that code doesn't. I'm about to open it again, after a little smoke. Maybe I'll hve a fresh perspective on it right now. :)

Edit: Thanks about the wiki, I *really* need to get it moved. The other machine is almost ready for it's new OS. Just have some more testing to do of certain applications (namely: my alarm clock). Then I just need to sit down with it and do it.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
Post Reply