Re: logic for creating maps in python

2020-08-19 Thread AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector


  


Re: logic for creating maps in python

So I thought I'd write you a little example to explain making a map file and a parser, then I realised that making parsers are a bitch.There's probably a few reasons to avoid parsers, but the main is validation.Say you create your map like @4 suggests, so you give each tile a numerical value. That's fine, but what if the map creator puts spaces between the characters? What if they type a letter instead of a number? or their number is out of range? What if they don't fill out the entire map? Do you fill the extra space with a "default" tile? Do you allow the map creator to specify the default?Better to make something like a command line (or GUI) based map editor, then dump the created maps using a language like YAML, or JSON.Then you can ignore validation errors, because if the person who created the map decides to fart about with the resulting map file, it's their loss when your program breaks.I've included a MAP file created with my own fledgling editor. As I'm sure you'll agree, it's quite complex, and not something you'd want to code by hand. That said, maps are complicated. If they're not, then they're simplistic. I'd wager that many of the best people for map creating are some of the worst for coding. Give them a lovely easy to use editor, and you'll be laughing.maps:
- ambiances:
  - sound: ambience\Lake.wav
x: 0
y: 0
z: 0
  default_surface_id: G7as96Ymnv3GczoWYaDBg5
  directions_2d:
  - north
  - north-east
  - east
  - south-east
  - south
  - south-west
  - west
  - north-west
  footstep_length: 0.5
  id: GQsnkuaqDQyZaNSphBVeAz
  max_x: 200
  max_y: 200
  start_facing: 0
  start_x: 0
  start_y: 0
  terrains:
  - end_x: 5
end_y: 5
start_x: 0
start_y: 0
surface_id: 6oFmgzkuYRAyrBc9HSXbfo
title: narrow path
  - end_x: 2
end_y: 2
start_x: 2
start_y: 2
surface_id: WRi82wWTpTmofhJgExnW9U
title: stone plaque
  title: Darkrise Forest
  turn_amount: 45
  wall_sound: wall.wav
- ambiances: []
  default_surface_id: 6oFmgzkuYRAyrBc9HSXbfo
  directions_2d:
  - north
  - north-east
  - east
  - south-east
  - south
  - south-west
  - west
  - north-west
  footstep_length: 0.5
  id: grQdN4HHzZrnoCf8aCyzUt
  max_x: 200
  max_y: 200
  start_facing: 0
  start_x: 0
  start_y: 0
  terrains: []
  title: Darkrise Village
  turn_amount: 45
  wall_sound: null
surfaces:
- footstep_sounds:
  - Surfaces\catwalk\Station1.wav
  - Surfaces\catwalk\Station2.wav
  - Surfaces\catwalk\Station3.wav
  - Surfaces\catwalk\Station4.wav
  - Surfaces\catwalk\Station5.wav
  - Surfaces\catwalk\Station6.wav
  - Surfaces\catwalk\Station7.wav
  - Surfaces\catwalk\Station8.wav
  id: CAndNXQagb39XMoTJUHtdP
  title: Catwalk
- footstep_sounds:
  - Surfaces\concrete\Room1.wav
  - Surfaces\concrete\room2.wav
  - Surfaces\concrete\room3.wav
  - Surfaces\concrete\Room4.wav
  id: 6oFmgzkuYRAyrBc9HSXbfo
  title: Concrete
- footstep_sounds:
  - Surfaces\duct\Duct1.wav
  - Surfaces\duct\Duct2.wav
  - Surfaces\duct\Duct3.wav
  - Surfaces\duct\Duct4.wav
  - Surfaces\duct\Duct5.wav
  - Surfaces\duct\Duct6.wav
  - Surfaces\duct\Duct7.wav
  id: Le52wgjqrWr8Usq3N7ekKb
  title: Duct
- footstep_sounds:
  - Surfaces\grass\Grass1.wav
  - Surfaces\grass\Grass2.wav
  - Surfaces\grass\Grass3.wav
  - Surfaces\grass\Grass4.wav
  - Surfaces\grass\Grass5.wav
  - Surfaces\grass\Grass6.wav
  - Surfaces\grass\Grass7.wav
  - Surfaces\grass\Grass8.wav
  id: G7as96Ymnv3GczoWYaDBg5
  title: Grass
- footstep_sounds:
  - Surfaces\gridwork\Ship1.wav
  - Surfaces\gridwork\Ship2.wav
  - Surfaces\gridwork\Ship3.wav
  - Surfaces\gridwork\Ship4.wav
  - Surfaces\gridwork\Ship5.wav
  - Surfaces\gridwork\Ship6.wav
  - Surfaces\gridwork\Ship7.wav
  - Surfaces\gridwork\Ship8.wav
  id: ZRhdNKbjyeVtoz4crS7U3W
  title: Gridwork
- footstep_sounds:
  - Surfaces\grit\Grit1.wav
  - Surfaces\grit\Grit2.wav
  - Surfaces\grit\Grit3.wav
  - Surfaces\grit\Grit4.wav
  - Surfaces\grit\Grit5.wav
  - Surfaces\grit\Grit6.wav
  - Surfaces\grit\Grit7.wav
  - Surfaces\grit\Grit8.wav
  id: WRi82wWTpTmofhJgExnW9U
  title: Grit
- footstep_sounds:
  - Surfaces\mud\Mud1.wav
  - Surfaces\mud\Mud2.wav
  - Surfaces\mud\Mud3.wav
  - Surfaces\mud\Mud4.wav
  - Surfaces\mud\Mud5.wav
  - Surfaces\mud\Mud6.wav
  - Surfaces\mud\Mud7.wav
  - Surfaces\mud\Mud8.wav
  id: CHMucvz9w2XCfP46mhcH9F
  title: Mud
- footstep_sounds:
  - Surfaces\sand\Sand1.wav
  - Surfaces\sand\Sand2.wav
  - Surfaces\sand\Sand3.wav
  - Surfaces\sand\Sand4.wav
  - Surfaces\sand\Sand5.wav
  - Surfaces\sand\Sand6.wav
  - Surfaces\sand\Sand7.wav
  - Surfaces\sand\Sand8.wav
  id: HBDBgnq9TJikXdG8Aa6xWk
  title: Sand
- footstep_sounds:
  - Surfaces\water\Water1.wav
  - Surfaces\water\Water2.wav
  - Surfaces\water\Water3.wav
  - Surfaces\water\Water4.wav
  id: bRD7uk6MWMG3keqAZQSwKv
  title: Water
title: Darkrise

URL: https://forum.audiogames.net/post/562703/#p562703




-- 
Audio

Re: logic for creating maps in python

2020-08-16 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: logic for creating maps in python

A typical way of implementing a 2D map editor involves assigning a numerical value to an object. So 0 = open space, 1 = a wall, 2 = bunnies, etc. Then the 2D array is populated with those items in a way that you want to create a map. Other numbers can also be associated with events triggers as well, such as 3 = open door, or 4 = spawn enemy at X, etc.Knowing this, you can create a syntax for creating your own maps into a text document or editor, have your program parse the text and create a map based on that. An example i've posted before is using BrushTone as a 2D map editor, since a single pixel is encoded as 3 values ranging from 0 to 255. A had written a simple script for reading the image and extracting the data to create a 2D map array, you can find that [here], post 9.

URL: https://forum.audiogames.net/post/562148/#p562148




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: logic for creating maps in python

2020-08-16 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: logic for creating maps in python

oh. i know that. i am constructing a 2d map and i wan't to know how tk and other games made like we can build our own maps in shelter and if you know envirement sueet then there we write a sintax and the program compiles theat sintax in to explorable map. how it is done. i wan't the little bit clue so that i can impliment in python

URL: https://forum.audiogames.net/post/562147/#p562147




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: logic for creating maps in python

2020-08-16 Thread AudioGames . net Forum — Developers room : magurp244 via Audiogames-reflector


  


Re: logic for creating maps in python

Maps in python are more or less just data, so it really depends on what kind of map you want to make, 2D/3D, etc. A map class can contain all sorts of data, but the primary data is usually the map itself which can consist of things like a 2D array to tell where objects or collision is along a 2D plane. Things like walking speed, jump time, jump range, etc. these are usually associated with individual actors, not the map itself perse, though it depends, like a gravity property perhaps or boosters.It all depends on what you have in mind and how you want to structure things really.

URL: https://forum.audiogames.net/post/562146/#p562146




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


logic for creating maps in python

2020-08-16 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


logic for creating maps in python

hey all, i am willling to create a map in python. the logic i use is,first i create a class for mapthen i initialize it with map name, walking speed, jumptime, jump range, etctis i use like when right arrow is pressed thenwhile elapsed time ob walking speed is <= walking speed of which is given by the usermove rightplay the step soundi got like this logic but in games like tk, sorry. but in those games we can make own maps by using map sintax. like that can we create a map compiler in python? like in bgt? if so, how please tell me.thanks in advance

URL: https://forum.audiogames.net/post/562138/#p562138




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector