I actually already made a level editor, but...

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
UncleSporky
Posts: 17
Joined: Fri Apr 13, 2012 2:28 am

I actually already made a level editor, but...

Post by UncleSporky »

I kind of stopped working on it, because things got complicated.

Here it is:

Image

It's programmed in Visual Basic 6. :P Sorry, it's what's available to me, and it's easy.

It already creates valid maps that work right now within LoG. When you save, it puts all maps in a local Maps folder as level01.lua, level02.lua, etc. You can open them in notepad to see the raw text.

But...

That stuff on the right? It doesn't work yet, and it's super complicated.

I've set up a linked list for each floor that allows an infintely-expanding list of objects on each floor (since you could theoretically have 100 swords sitting on the same tile, if you wanted). Its class includes variables for all types of objects - scroll text, whether a door is initially closed or open, etc. However, this is just the beginning.

Challenges:

- I have to detect what type of object the player is adding and hide or show controls accordingly. If they're adding a monster, then they can't type wall text for it. If they're adding a secret button, they can't set it's monster AI state to "guard."

- I have to write something that can interpret every type of object and create valid LUA code for it. For example, a player can choose to add a slime at 2,3 on floor 4 facing south with guard AI turned on, and I have to open level04.lua and output spawn("slime",2,3,2) :setAIState("guard"). For tons and tons of object types. Many are similar but it's a lot of work.

- I have to draw all these objects on the map in some way, so users can remember where they put things...and I have to draw them in a certain order. I don't want door icons covered up by monster icons, etc.

- I would want to provide better options for saving and loading of map files, and possibly packing them together in one big group, but it certainly wouldn't be the format used by the devs and I wouldn't want to split the userbase.

- Timers and stuff like earthquakes and dream-triggering code seems complicated and also relies on other game files, more than regular objects already do.

- I don't have access to the internals like the devs do, I mostly just know the map format. Floors 1-4 will always be dungeon-type, floors 5 on are temple-type, etc. And I have no idea how to support custom objects made by players down the line. They'll be able to deliver a far more robust editor anyway.

- Since official mapmaking tools aren't out yet, the only way for people to use these maps currently is to edit Grimrock.dat and zero out the hash file names of levels, and put additional folders in their Grimrock installation directory with maps in them. In the interest of professionalism I would want to write a tool that would do this automatically for people, as well as restoring Grimrock.dat to its original state, but the logistics of doing that are crazy, especially with patches and such that could make it stop working.

- My coding is terrible and I feel like I am doing everything the wrong way!

Oh well.

On the upside, I think it's likely that if nothing else, level layouts made using this editor will work with the official editor when it comes out. The devs haven't said anything about that, but it's just a standard LUA level, it ought to work. :)

Here it is if you want to download what I've got. I have no idea about dependencies, it might not even work for anyone but me. If it doesn't I'll probably have to include some DLLs.

Right clicking erases hallways back to solid walls. You can press left and right on the keyboard to go up and down floors, useful for placing stairs right above/below other stairs. Also, with the starting "S" selected, you can click directly on your chosen starting location to alter which direction the player faces at game start.
Last edited by UncleSporky on Wed Apr 25, 2012 12:20 am, edited 1 time in total.
User avatar
Jack Dandy
Posts: 476
Joined: Fri Mar 02, 2012 2:22 pm
Location: Haifa, Israel

Re: I actually already made a level editor, but...

Post by Jack Dandy »

This is great! Good job, and thanks for spending time to make this.

I'll have to wait for the official version, though.
Crise
Posts: 54
Joined: Wed Apr 04, 2012 4:59 pm

Re: I actually already made a level editor, but...

Post by Crise »

The basic concept of this editor is great... you can draw the basic layout of the floor quickly. Then you could add the script interactions after that, by simply choosing the tiles that the interactions involve.

Let's see how the official comes out though. The main point I really like though is that the generic layout is quick to set up, and then stuff would be contextual after that I assume.
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: I actually already made a level editor, but...

Post by HaunterV »

Cool.
I say either still plod ahead for personal advancement, I bet AH will have something that looks and possibly functions similar... unless they want to try and keep the hotloading feature from directly editing the text layout of the level files.
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
Dynosaulo
Posts: 15
Joined: Sun Apr 22, 2012 6:24 pm
Location: Brazil

Re: I actually already made a level editor, but...

Post by Dynosaulo »

HaunterV wrote:(...) unless they want to try and keep the hotloading feature from directly editing the text layout of the level files.
Well, I guess there's nothing stopping this feature from working even when using the editor. Think about it... You edit the dungeon and click "save". When you do that, the editor changes the level files and it's just as if you've manually changed them.

I'm no programmer, but I see no problem with that.
User avatar
atamanashi
Posts: 8
Joined: Wed Apr 11, 2012 6:12 am

Re: I actually already made a level editor, but...

Post by atamanashi »

it really shows a fan that's willing to make there own editor. thanks this will keep me from being bored tonight
Xombium
Posts: 30
Joined: Wed Apr 18, 2012 11:58 am

Re: I actually already made a level editor, but...

Post by Xombium »

Yeah, not sure why no one mentioned it doesn't work. Did anyone actually try the editor or just comment?

Got some COMDLG32.OCX error.
User avatar
Darklord
Posts: 2001
Joined: Sat Mar 03, 2012 12:44 pm
Location: England

Re: I actually already made a level editor, but...

Post by Darklord »

Xombium wrote:Yeah, not sure why no one mentioned it doesn't work. Did anyone actually try the editor or just comment?

Got some COMDLG32.OCX error.
It was mentioned in the first post.

UncleSporky wrote:it might not even work for anyone but me. If it doesn't I'll probably have to include some DLLs.
Daniel.
A gently fried snail slice is absolutely delicious with a pat of butter...
lastsaves
Posts: 25
Joined: Sat Apr 14, 2012 8:21 pm

Re: I actually already made a level editor, but...

Post by lastsaves »

UncleSporky wrote:I kind of stopped working on it, because things got complicated.
It looks awesome. 8-)
Do you really stopped working on it?
Or... there is a chance it might be developed further?
Celdritch
Posts: 1
Joined: Sat Apr 28, 2012 4:38 pm

Re: I actually already made a level editor, but...

Post by Celdritch »

Well done so far! Keep it going! For those with the .OCX error follow the steps found here (for XP/Vista/7 and x86/x64 systems): http://devonenote.com/2010/02/register- ... -x64-win7/
Post Reply