WalkMap

If I need a walkmap for my game,
it’s better store it as an array,
or as a simply bitmap?

thanks
Alessandro

Well, that depetds. What kind of info do you need to store? How big is
the map? What’s the resolution of the walk map? (Tiles or pixels.)

A bitmap is harder and slower to access - except when the map is so
big that an array of bytes or larger elements wouldn’t fit in the
cache.

That said, if you’re only checking a few or a few tens of pixels/tiles
every frame, don’t worry about this. Just do it the easiest way.

If the map becomes too big and/or you end up using it a lot more than
you expected, it’s trivial to change, as long as you keep the low
level code in one place, in inline functions, macros or something.

At that point, you might also want to consider a structured walk map
of some sort. You could use something like sorted trees of rectangles
or polygons, which also has the advantage that you can implement very
fast search algorithms for bullet trajectory checking and stuff like
that.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Monday 03 November 2003 23.53, Alessandro Ardolino wrote:

If I need a walkmap for my game,
it’s better store it as an array,
or as a simply bitmap?

I’m trying to port my Win32 SDL app over to Mac OS X. I own the latest
CodeWarrior, which is what I’m using to compile on both platforms. My
problem is that I am running into some link errors on OS X that I have not
been able to resolve.

The errors are undefined function errors. Specifically, all the public
functions of the add on libs I am using (IMG, mixer, and TTF) that are
referenced in my app are reported to by undefined. The SDL functions,
however, are linking without problems.

I have included the SDL framework, as well as the frameworks for the add on
libs in my Mach-O project. The SDL framework is included first, but
strangely, if I reverse the order (include an add-on framework before the
SDL framework), CW hangs stalled during link and I have to force quit.

I tried building the add on frameworks myself using CW, and I got them to
build but I had the exact same result when I tried to link my app.

Is there a step I am missing here? This is my first attempt to compile a
Mach-O executable that uses non-standard frameworks. Perhaps something
elementary I overlooked?

Any help would be greatly appreciated.

Thanks,
Dave

I have a walkmap for a graphic adventure,
the size is 400*300,
and I use as walkmap and eventmap.

I need some pathfinding algorithm to use with the walkmap.

What data stucture is better for this?> ----- Original Message -----

From: david@olofson.net (David Olofson)
To:
Sent: Tuesday, November 04, 2003 12:29 AM
Subject: Re: [SDL] WalkMap

On Monday 03 November 2003 23.53, Alessandro Ardolino wrote:

If I need a walkmap for my game,
it’s better store it as an array,
or as a simply bitmap?

Well, that depetds. What kind of info do you need to store? How big is
the map? What’s the resolution of the walk map? (Tiles or pixels.)

A bitmap is harder and slower to access - except when the map is so
big that an array of bytes or larger elements wouldn’t fit in the
cache.

That said, if you’re only checking a few or a few tens of pixels/tiles
every frame, don’t worry about this. Just do it the easiest way.

If the map becomes too big and/or you end up using it a lot more than
you expected, it’s trivial to change, as long as you keep the low
level code in one place, in inline functions, macros or something.

At that point, you might also want to consider a structured walk map
of some sort. You could use something like sorted trees of rectangles
or polygons, which also has the advantage that you can implement very
fast search algorithms for bullet trajectory checking and stuff like
that.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Alessandro,

Maybe you can try my path finding library, APF:
http://www.geocities.com/andre_leiradella/#apf. It’s an almost complete A*
implementation (will be some day I expect).

APF does not impose any particular data structure and is suitable for small
maps. It comes with an example of a ghost chasing the mouse cursor in a
pacman-like maze so you can get started very quickly.

Regards,

Andre de Leiradella
http://www.geocities.com/andre_leiradella/> ----- Original Message -----

From: aleardo@libero.it (Alessandro Ardolino)
To:
Subject: Re: [SDL] WalkMap
Date: Tue, 4 Nov 2003 11:43:24 +0100
Reply-To: sdl at libsdl.org

I have a walkmap for a graphic adventure,
the size is 400*300,
and I use as walkmap and eventmap.

I need some pathfinding algorithm to use with the walkmap.

What data stucture is better for this?

thanks Andre,
it’s what I need…> ----- Original Message -----

From: leiradella@bigfoot.com (Andre de Leiradella)
To:
Sent: Wednesday, November 05, 2003 11:53 AM
Subject: Re: Re: [SDL] WalkMap

Alessandro,

Maybe you can try my path finding library, APF:
http://www.geocities.com/andre_leiradella/#apf. It’s an almost complete A*
implementation (will be some day I expect).

APF does not impose any particular data structure and is suitable for
small
maps. It comes with an example of a ghost chasing the mouse cursor in a
pacman-like maze so you can get started very quickly.

Regards,

Andre de Leiradella
http://www.geocities.com/andre_leiradella/

----- Original Message -----
From: “Alessandro Ardolino”
To:
Subject: Re: [SDL] WalkMap
Date: Tue, 4 Nov 2003 11:43:24 +0100
Reply-To: sdl at libsdl.org

I have a walkmap for a graphic adventure,
the size is 400*300,
and I use as walkmap and eventmap.

I need some pathfinding algorithm to use with the walkmap.

What data stucture is better for this?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Just wanted to let people know that I solved this problem. It was actually a
bug in the CodeWarrior linker. I alerted Metrowerks and they fixed it in the
9.1 update. The issue was the underscore in the framework names (e.g.
“SDL_image”). For some reason this was confusing the linker. The new CW 9.1
however can link the frameworks without a problem.

Cheers,
Dave

on 11/3/03 4:17 PM, Dave Beck at @Dave_Beck wrote:>

I’m trying to port my Win32 SDL app over to Mac OS X. I own the latest
CodeWarrior, which is what I’m using to compile on both platforms. My
problem is that I am running into some link errors on OS X that I have not
been able to resolve.

The errors are undefined function errors. Specifically, all the public
functions of the add on libs I am using (IMG, mixer, and TTF) that are
referenced in my app are reported to by undefined. The SDL functions,
however, are linking without problems.

I have included the SDL framework, as well as the frameworks for the add on
libs in my Mach-O project. The SDL framework is included first, but
strangely, if I reverse the order (include an add-on framework before the
SDL framework), CW hangs stalled during link and I have to force quit.

I tried building the add on frameworks myself using CW, and I got them to
build but I had the exact same result when I tried to link my app.

Is there a step I am missing here? This is my first attempt to compile a
Mach-O executable that uses non-standard frameworks. Perhaps something
elementary I overlooked?

Any help would be greatly appreciated.

Thanks,
Dave


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Rant {
Well, be thankful you use a compiler who’s owner will fix bugs, and not just
dismiss them as the programmer’s bad coding (Shame you, Microsoft, shame
you)
}> ----- Original Message -----

From: davethebrv@crystalpiersw.com (Dave Beck)
To:
Sent: Monday, December 01, 2003 2:56 AM
Subject: Re: [SDL] Mac OS X CodeWarrior linking woes

Just wanted to let people know that I solved this problem. It was actually
a
bug in the CodeWarrior linker. I alerted Metrowerks and they fixed it in
the
9.1 update. The issue was the underscore in the framework names (e.g.
“SDL_image”). For some reason this was confusing the linker. The new CW
9.1
however can link the frameworks without a problem.

Cheers,
Dave

on 11/3/03 4:17 PM, Dave Beck at davethebrv at crystalpiersw.com wrote:

I’m trying to port my Win32 SDL app over to Mac OS X. I own the latest
CodeWarrior, which is what I’m using to compile on both platforms. My
problem is that I am running into some link errors on OS X that I have
not

been able to resolve.

The errors are undefined function errors. Specifically, all the public
functions of the add on libs I am using (IMG, mixer, and TTF) that are
referenced in my app are reported to by undefined. The SDL functions,
however, are linking without problems.

I have included the SDL framework, as well as the frameworks for the add
on

libs in my Mach-O project. The SDL framework is included first, but
strangely, if I reverse the order (include an add-on framework before
the

SDL framework), CW hangs stalled during link and I have to force quit.

I tried building the add on frameworks myself using CW, and I got them
to

build but I had the exact same result when I tried to link my app.

Is there a step I am missing here? This is my first attempt to compile a
Mach-O executable that uses non-standard frameworks. Perhaps something
elementary I overlooked?

Any help would be greatly appreciated.

Thanks,
Dave


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.541 / Virus Database: 335 - Release Date: 11/14/2003