Re: what are data bases

For a more "gamie" example, let's pretend you have a load of maps. They all have players on them, and some have a boss NPC that rattles around killing stuff.

Your "boss" wants to find players, but it isn't interested in wounded players, because that's just mean. You could use something like the following:

boss_location_id = <boss.location_id>
select id from players where location_id = boss_location_id and health > 50 order by (health and function to figure out distance).

That would have the boss heading towards the player with the most health, while applying some function to detect distance.

BTW, I don't actually know SQL all that well, so please don't copy and paste that example haha. SQL is pretty human-readable though, so it's usually pretty obvious what's going on.

If you're writing Python, I would really recommend using https://www.sqlalchemy.org/]SQLAlchemy.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector

Reply via email to