Level Editor
2 posters
Page 1 of 2
Page 1 of 2 • 1, 2
Level Editor
Thinking of taking on the level editor. Just a few questions:
Will levels be edited/created using a mouse in a separate GUI?
Will the output only need to be a set of coordinates?
Cheers
Will levels be edited/created using a mouse in a separate GUI?
Will the output only need to be a set of coordinates?
Cheers
moe_b- Posts : 12
Join date : 2010-06-05
Re: Level Editor
moe_b wrote:Thinking of taking on the level editor. Just a few questions:
Will levels be edited/created using a mouse in a separate GUI?
Will the output only need to be a set of coordinates?
Cheers
Right now, a working level editor is more important than exactly where it is, in game or otherwise.
If you need, I can provide a small pygame lib that can handle most simple GUI tasks (a menu bar, messageboxes etc...) that might make this thing easier to do in pygame.
Right now the game cheats a little and uses simple lines as the edges of the level, this will almost certainly need to be changed to convex polygons.
Also, we'll need the facility to add static and non-static items to the map; although the difference to the map editor is moot (maybe you'll want too edit the mass / elasticity of non-static objects).
Tonight I'll try and build a mockup of the data structure needed for the current level and post it here.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
Sounds good. A pygame lib to help with the GUI would be useful.
moe_b- Posts : 12
Join date : 2010-06-05
Re: Level Editor
I'll upload something to svn in the next 24 hours... tonight I'm working on bullets, but I'll have some time tomorrow.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
Here's the first bit of help. The current level in svn SHOULD be stored as a series of convex polygons:
There you can see each separate polygon. Then, you just need to output the co-ords of each polygon in some basic text format. A human friendly format is good, I can write a parser to handle loading at the other end.
At the moment I cheat and just add simple lines, but this is just to test the physics engine and we will need to use polygons in the future.
So the editor must in some simple way let you draw out simple polygons. Bonus points if you can edit them, and extra bonus points if you can verify they are convex
We'll also need the ability to add static objects and edit the object parameters but this basic ability of editing convex polygons is the hardest part.
There you can see each separate polygon. Then, you just need to output the co-ords of each polygon in some basic text format. A human friendly format is good, I can write a parser to handle loading at the other end.
At the moment I cheat and just add simple lines, but this is just to test the physics engine and we will need to use polygons in the future.
So the editor must in some simple way let you draw out simple polygons. Bonus points if you can edit them, and extra bonus points if you can verify they are convex
We'll also need the ability to add static objects and edit the object parameters but this basic ability of editing convex polygons is the hardest part.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
moe_b wrote:Sounds good. A pygame lib to help with the GUI would be useful.
I've ripped out the GUI from SPQR and stripped out all the extras to produce a simple outline of an editor (and I do mean SIMPLE ).
I need to amend to our code style and give some pointers about how to use it, I'll work on that tonight probably. In the meantime, can you update to the latest svn and run editor,py, found in the new editor folder, and check it works?
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
Just tried running it, got an error:can you update to the latest svn and run editor,py, found in the new editor folder, and check it works?
- Code:
moe@moe-ubuntu10:~/code/s8/scheme7/editor$ python editor.py
Traceback (most recent call last):
File "editor.py", line 75, in <module>
main()
File "editor.py", line 72, in main
editor.gui.mainLoop()
File "/home/moe/code/s8/scheme7/editor/scripts/gui.py", line 341, in mainLoop
self.checkInputs()
File "/home/moe/code/s8/scheme7/editor/scripts/gui.py", line 196, in checkInputs
self.testMouse(x,y,action)
File "/home/moe/code/s8/scheme7/editor/scripts/gui.py", line 327, in testMouse
if(self.map_area.collidepoint(x,y)==True):
AttributeError: CGFXEngine instance has no attribute 'map_area'
moe_b- Posts : 12
Join date : 2010-06-05
Re: Level Editor
Update SVN, it should work now!
I am also aware you need some guidelines about how the code works, give me a few more hours
I am also aware you need some guidelines about how the code works, give me a few more hours
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
Had a bit of an issue with pymunk the last day or so, wasn't very clear how to add solid bodies (fixed that just now though). So it'll be tomorrow night I can look at the GUI code again.
I'll also know what data the map editor needs to spit out. I don't really care what format it's saved as, as long as it's human readable (and editable).
I'll also know what data the map editor needs to spit out. I don't really care what format it's saved as, as long as it's human readable (and editable).
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
I've completed a very primitive program for drawing out polygons.
Currently you can only draw polygons in it using a "line tool" by drawing lines that connect together, then right-clicking the mouse when you are finished drawing the polygon (then you can start a new polygon).
Upon exit of the program it appends the coordinates of all the drawn polygons to a text file along with a datetime of creation.
The code is a bit messy, and I still need to add lots of stuff (e.g. rectangle and circle drawing tools, convex verification, editing drawn polygons, etc.) but this is a start. You can at least start creating simple levels with it (I hope).
Can I get access to the svn in order to upload it? Cheers.
Currently you can only draw polygons in it using a "line tool" by drawing lines that connect together, then right-clicking the mouse when you are finished drawing the polygon (then you can start a new polygon).
Upon exit of the program it appends the coordinates of all the drawn polygons to a text file along with a datetime of creation.
The code is a bit messy, and I still need to add lots of stuff (e.g. rectangle and circle drawing tools, convex verification, editing drawn polygons, etc.) but this is a start. You can at least start creating simple levels with it (I hope).
Can I get access to the svn in order to upload it? Cheers.
moe_b- Posts : 12
Join date : 2010-06-05
Re: Level Editor
I'm at work now, as soon as I find the time I'll set it up and send you a pm (internet here is VERY slow...)
EDIT: do you have a sourceforge account?
EDIT: do you have a sourceforge account?
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
do you have a sourceforge account?
Just created it now. My username is mburney
moe_b- Posts : 12
Join date : 2010-06-05
Re: Level Editor
Ok, I've added you as a member of the team on sourceforge. You should be able to commit to svn with your s/f name and password.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
Works fine here.
I put your code into the GUI code, you can see how it fits if you examine editor.py. Whether this an avenue we can explore or not can be discussed as the code gets more complex.
I put your code into the GUI code, you can see how it fits if you examine editor.py. Whether this an avenue we can explore or not can be discussed as the code gets more complex.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
The game itself now uses a set of polygons to build the level. I'll add some command line reading to the code so we can test levels built in the editor.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
Sounds good! Apologies I have not been able to make a new version yet; will get back on it this weekend.
The game looks great so far.
The game looks great so far.
moe_b- Posts : 12
Join date : 2010-06-05
Re: Level Editor
moe_b wrote:Sounds good! Apologies I have not been able to make a new version yet; will get back on it this weekend.
No need for apologies, just checking how things were. I think I put a simple level editor in the v0.2 specs, but it looks like v2 will be out next week so I wanted to know what the situation will be.
It's no real stress as v0.3 will be a bit more boring - unit tests, code refactor, small optimisations and so on. The level editor can wait until then if it has too
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
Latest SVN (revision 74 and upwards) now reads the level data from a file - the simple file is in /levels/level1.s7.
Hopefully the format is pretty easy to read and understand and even simpler to spit out with code
Hopefully the format is pretty easy to read and understand and even simpler to spit out with code
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
OK, I finally have some time to get back to work on the level editor. Will try to do some iterations this week
moe_b- Posts : 12
Join date : 2010-06-05
Re: Level Editor
moe_b wrote:OK, I finally have some time to get back to work on the level editor. Will try to do some iterations this week
Cool! I myself have not been so busy since I bought a house this week and will move on Friday. But if you have any questions about the new file format then let me know.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
Things that are currently in the parsed file:
Convex polygons, described by a series of points.
The player start position.
Static sprites, their name and position.
Detectors, and the item which they trigger.
The level name, and the base colour.
Convex polygons, described by a series of points.
The player start position.
Static sprites, their name and position.
Detectors, and the item which they trigger.
The level name, and the base colour.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
I am going to study the parser, but also if possible could you elaborate on the CircleDetector, I am not sure what it does
moe_b- Posts : 12
Join date : 2010-06-05
Re: Level Editor
CircleDetector is an object that has a radius and a position. When the player enters this area, it triggers other objects (for example, guns that shoot at the player).
Currently the radius and position are in the parser but the trigger data isn't (it should have a list of the names of the items to trigger.
Also, sorry about the lack of updates these last few weeks. I bought a new house, so I've had to move (stress), managed to break my main computer (annoying) and also it will be another week before I get the internet back at my home - all of which means it'll be another week before I start to go back to coding the game.
Currently the radius and position are in the parser but the trigger data isn't (it should have a list of the names of the items to trigger.
Also, sorry about the lack of updates these last few weeks. I bought a new house, so I've had to move (stress), managed to break my main computer (annoying) and also it will be another week before I get the internet back at my home - all of which means it'll be another week before I start to go back to coding the game.
maximinus- Admin
- Posts : 63
Join date : 2010-06-04
Age : 51
Location : Harbin, China
Re: Level Editor
No problem, I'm behind schedule on the level editor anyway...will get a new version up soon though.
Just wondering also if you have any more specs for how you want the editor to look and feel...for example do you want to draw the entire level on an 800 X 600 screen and then the editor just scales it up for the actual level? Also for adding sprites, static objects etc. do you want a toolbar ?
Cheers
Just wondering also if you have any more specs for how you want the editor to look and feel...for example do you want to draw the entire level on an 800 X 600 screen and then the editor just scales it up for the actual level? Also for adding sprites, static objects etc. do you want a toolbar ?
Cheers
moe_b- Posts : 12
Join date : 2010-06-05
Page 1 of 2 • 1, 2
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum