Level Editor

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

Level Editor

Post  moe_b on Sun Jun 06, 2010 7:19 am

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

moe_b

Posts : 12
Join date : 2010-06-05

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Sun Jun 06, 2010 10:32 am

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.
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  moe_b on Sun Jun 06, 2010 4:18 pm

Sounds good. A pygame lib to help with the GUI would be useful.

moe_b

Posts : 12
Join date : 2010-06-05

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Sun Jun 06, 2010 9:13 pm

I'll upload something to svn in the next 24 hours... tonight I'm working on bullets, but I'll have some time tomorrow.
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Mon Jun 07, 2010 12:48 am

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 Cool

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.
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Mon Jun 07, 2010 11:51 am

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 Smile ).

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?
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  moe_b on Mon Jun 07, 2010 11:58 am

can you update to the latest svn and run editor,py, found in the new editor folder, and check it works?
Just tried running it, got an error:

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

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Mon Jun 07, 2010 12:33 pm

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 Very Happy
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Tue Jun 08, 2010 11:34 pm

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).
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  moe_b on Wed Jun 09, 2010 10:47 am

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.

moe_b

Posts : 12
Join date : 2010-06-05

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Wed Jun 09, 2010 1:48 pm

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?
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  moe_b on Wed Jun 09, 2010 4:48 pm

do you have a sourceforge account?

Just created it now. My username is mburney

moe_b

Posts : 12
Join date : 2010-06-05

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Wed Jun 09, 2010 8:26 pm

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.
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  moe_b on Thu Jun 10, 2010 3:39 pm

OK, the file is on there now (levedit.py)

moe_b

Posts : 12
Join date : 2010-06-05

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Fri Jun 11, 2010 9:40 pm

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.
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Mon Jun 21, 2010 12:03 am

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.
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  moe_b on Wed Jun 23, 2010 9:43 am

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.

moe_b

Posts : 12
Join date : 2010-06-05

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Wed Jun 23, 2010 4:29 pm

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 Very Happy
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Mon Jun 28, 2010 1:59 pm

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 Smile
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  moe_b on Mon Jul 19, 2010 2:44 pm

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

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Mon Jul 19, 2010 9:58 pm

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.
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Sat Jul 24, 2010 10:40 pm

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.
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  moe_b on Mon Aug 09, 2010 4:02 am

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

View user profile

Back to top Go down

Re: Level Editor

Post  maximinus on Tue Aug 10, 2010 4:40 pm

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.
avatar
maximinus
Admin

Posts : 63
Join date : 2010-06-04
Age : 44
Location : Harbin, China

View user profile

Back to top Go down

Re: Level Editor

Post  moe_b on Tue Aug 17, 2010 5:40 am

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

moe_b

Posts : 12
Join date : 2010-06-05

View user profile

Back to top Go down

Re: Level Editor

Post  Sponsored content


Sponsored content


Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum