Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Level Editor For Your Games

Author
Message
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 5th Mar 2008 21:06 Edited at: 25th Mar 2008 18:27
Helping someone in another thread, it got to the stage where the subject of level editors came up. They make life so much easier to create levels.

So, I set about creating a simple level editor to demonstrate how one could be created. It also proved useful to fully test my GUI function collection - which as it happened, did need a bit of bug-fixing!

After a couple of days coding, it's coming on nicely and decided to make it an 'open source' sort of thing where anyone can download it and just change the load and save level procedures to match your game.

[Edit] Due to lack of interest, I decided to spruce it up a bit and release it as an exe rather than source code. The program options will allow you to tailor it for your own game by selecting what data to save in the level file.

It's not quite 100% yet, but I'd like your opinions on the interface. I've included a small text file in the zip file to cover it's use along with an exe version for those of you who don't have DBC and would like to try it out.

Comments welcome!

Download: http://www.computechtenerife.com/levelmaker0_7.zip (900K)

TDK_Man

Insert Name Here
17
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 5th Mar 2008 21:21
Could we please see a screen shot before we download? (Not that I doubt the quality of your work )

Lee Bamber - Blame Beer
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 5th Mar 2008 21:56 Edited at: 5th Mar 2008 23:41
[Edit] Decided to remove the screenshot I put up as I was asking for people to comment on the interface. To do that they need to actually try using it.

With a screenshot, comments tend to be on what they see in the picture and they don't actually download it. If that happens I won't get the feedback I need.

TDK_Man

DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 5th Mar 2008 22:24
Very nice TDK. Does DBC hsve the CSG commands because those would be kinda cool to add.


I'm Pro grammer.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Mar 2008 23:24 Edited at: 10th Apr 2008 09:44
@TDK

As far as the interface, I think maybe a few shortcuts like 'R' to switch to rotate mode or 'P' for placement mode instead of the generic M key. Also, you made those nifty text box GUIs why not have the option to key in a position or a rotation instead of only managing it with the mouse? Or at least for rotation.

When loading a model, don't assume the center of the object is at 0,0,0 . When trying to put the bounding box around it, it can be off-center. Perhaps instead of a bounding box, clone the loaded object and scale the clone a little bigger and set it to wire frame. Or if you decide to use memblocks, you can find the rotation point of the loaded object and offset the bounding box to that. Load the Goblin model that comes with DBC and you'll see what I'm talking about.

Enjoy your day.
Sinani201
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 6th Mar 2008 05:33 Edited at: 6th Mar 2008 05:49
Shouldn't this be in Program Announcement
It looks fine. I understand that it's not 100%, as you said, but I'm looking forward to seeing more of it.
The only problem is, when I close it, the music keeps playing! It's playing as I'm typing this. But I have ways to make these things stop...

Seriously, how do you make the little blue text come up below your message?
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Mar 2008 16:51 Edited at: 6th Mar 2008 16:57
Quote: "As far as the interface, I think maybe a few shortcuts like 'R' to switch to rotate mode or 'P' for placement mode instead of the generic M key. Also, you made those nifty text box GUIs why not have the option to key in a position or a rotation instead of only managing it with the mouse? Or at least for rotation."


Already in there!

Quote: "I've included a small text file in the zip file to cover it's use"


I'll check the zip again - hope I didn't forget to include the doc file...

Quote: "instead of a bounding box, clone the loaded object and scale the clone a little bigger and set it to wire frame."


Great idea! I'll add that if you don't mind...

As for moving the objects, this version needed to work like a modelling program. When support for loading and editing matrices is added, there will be another placement mode added.

Quote: "Shouldn't this be in Program Announcement"


No - it's not a program announcement. When finished, it will be source-code only and when I started this thread it included all the source code.

However, I just wanted feedback on the interface so I removed the dba file and replaced it with an exe so people who didn't have DBC could run it and comment.

If anywhere, when finished it will probably end up in Code Snippets.

Quote: "The only problem is, when I close it, the music keeps playing!"


ROTFL!!

Nice one... There's no music in it! What on earth are you running?

[Edit] Oops - missed a question:

Quote: "does DBC hsve the CSG commands because those would be kinda cool to add."


Nope - they aren't supported in DBC. But when finished, you could always port the source code over to DBP if you wanted to.

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Mar 2008 17:48
Quote: "Already in there!"


OOOPS! My fault for not reading the instructions carefully. I would, however, like to see all three coordinates at the same time for direct entry of positioning or rotation instead of x, then y, then z as separate controls.

TDK, do you want changes or additions to the source code as this develops? If so, how would you want that submitted? I could see it becoming extremely unmanageable with lot's of submissions that weren't ordered according to some set of rules or specifications. For example, a mouse-driven menu system would be a nice addition. Freddix had made a complete menu system library as part of his Magic-Windows which I don't think uses any memblocks or enhanced commands and it is available as open-source.

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Mar 2008 18:40 Edited at: 6th Mar 2008 18:48
I would, however, like to see all three coordinates at the same time for direct entry of positioning or rotation instead of x, then y, then z as separate controls.

Good - and fair - point. Will look into adding that.

Quote: "TDK, do you want changes or additions to the source code as this develops?"


I don't think so. My intention was to simply release the finished source code for users to modify and use as they want. A mention in a text file saying a supplied level editor was based on this one would be nice, but not essential.

I know I mentioned Open Source, but only in so much as it's source and it's open to be used as you like. I don't think a co-ordinated altering of the code is really worth it as the changes you make to suit your project may not be of use to me - and vice-versa.

Quote: "For example, a mouse-driven menu system would be a nice addition."


That's not a problem. I have my own media-less drop-down menu function I could drop in - or there's the graphical button panel which is already in my GUI function collection.

Which do you think would be best - drop-down menu or tool panel?

[Edit] Forgot to mention that your method for highlighting .X objects worked perfectly!



TDK_Man

Yodaman Jer
User Banned
Posted: 6th Mar 2008 20:31
How about drop-down menus? Those work fine.
Very nice app so far TDK! I encountered a couple of errors, but that's normal in the (alpha?) first releases. I can't wait to see what you do next!

I do have one suggestion...
I think the camera should be able to be positioned ANYWHERE with the mouse. Think of CS4 and how that allows you to go anywhere in the level and edit a part of it. And also maybe a texturing mode wouldn't be a bad addition either...I'd also suggest light mapping but that would be a lot of work and I can do that without having to use special programs!

Thanks for the great app. so far!

Yodaman Jer


Thanks BigAdd!!
Link102
19
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 6th Mar 2008 21:20
This is impressive but I found this a bit contraining. Mainly due to the fact that drop down menu's are missing and the camera is not free.
a suggestion (if it's not already in the program); when editing a object property press tab to make a input box apear where you can type the value.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Mar 2008 22:50
Quote: "Mainly due to the fact that drop down menu's are missing and the camera is not free."


This has already been pointed out - and as I've said, I agree and I'm working on it.

Quote: "a suggestion (if it's not already in the program)"


Documentation files are supplied for a reason you know...

Quote: "when editing a object property press tab to make a input box apear where you can type the value."


RTFM - and previous posts!

TDK_Man

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 9th Mar 2008 08:21 Edited at: 10th Mar 2008 18:38
The mouse-driven GUI is now almost fully implemented and since no-one answered my question about what method to use I decided myself - on a button toolbar.

Texturing is now implemented, but as yet no free roaming camera.

Download: [Removed - See Below]

Copy a few BMP textures into the Textures folder and a few .X files into the Models folder - it makes testing it a bit easier.

YDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Mar 2008 20:21
@TDK
The executable is so slow I find it unusable and thus untestable. The mouse barely moves and when it does, it jumps.

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Mar 2008 18:37
I hadn't noticed a problem on my machine, but I took a look and found a problem - just one single 0 when it should have been a 1 meant a function was being called continuously - not good on slower machines!

But, I didn't find it straight away and blamed the GUI function collection at first and decided to re-write sections.

So, the problem is now fixed and when I've finished converting the function collection I'll repost that version.

Thanks for trying to test it though!

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Mar 2008 20:06
I reread my comment and the way it is written sounds a bit harsh... sorry for that!

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Mar 2008 11:09
No problem.

Here's the replacement V0.4 - cleverly called V0.4b!

You should find it a bit better than the last V0.4 anyway...

Download: http://www.computechtenerife.com/levelmaker0_4.zip

@All

New doc file updated for all the changes, so if something doesn't work, please check it out before shouting at me!

TDK_Man

Yodaman Jer
User Banned
Posted: 12th Mar 2008 15:57
I love the interface! It works really well and it was easy to figure out what button did what exactly.
I have only one complaint: The FPS was only up to 5!!
Otherwise it worked great for me.


Thanks BigAdd!!
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 12th Mar 2008 18:57
Quote: "The FPS was only up to 5"


Do you get only 5 FPS all the time - from the moment you run it?

If so, what are your machine specs (OS/CPU/MemoryGFX Card).

I'm having a session today to get to the bottom of the FPS issue because for I'm pretty sure it's something to do with sprites.

It doesn't help for me however when my system never, ever gives me more than 63 FPS in DBC. This means so I can never tell if I've done anything to improve things.

I might also have to move this to the WIP board because I'm desperate for more feedback and there's not enough traffic on this board...

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Mar 2008 20:17
I tried the new version, it moves along pretty slowly. On startup, the fps reads 24. As soon as I select an option from the tool bar, it drops down to 12. It doesn't matter what the option is. I don't even have to have an object on screen. There is a problem with the drawing and refreshing of the toolbar. On startup, click on any option that doesn't bring up a dialog box. Now drag the title bar. It will leave a copy of the tool bar behind and on my machine the fps drops to about 7 but then creeps back up to 12.

I like the status bar at the bottom of the screen. It seems to work fine and clicking on the buttons didn't change the FPS.

One thing I would like, for scaling in particular, is if the X,Y and Z limits are all open, then scaling with only the left mouse botton should occur on those allowed axes simultatneously. You have the left-right combo to scale all at once, but it seems to defeat the process of limiting or unlimiting the axes. Why would I set x and y to be limtied to and then have to size each one separately? Intuitively, I'm trying to size them both at once. If I wanted them limited, I'd turn off the one I don't want to size. Know what I mean?

I'd also like to see a "snap to angle, size, or position option." Perhaps if a certain key is held, the size or the rotation of an object would increase or decrease only based on a specific value.

I find the confirmation box when adding a primative to be a time waster. While deleting an object I think it is necessary to avoid losing hard work, I don't think it's necessary when adding an object and just gives me one more thing to click on every time I want a new object. Maybe it should remain as a result from the tool bar but at least if you press a quick key to add a primative there shouldn't be a dialog.

The 3d mouse select method could use some adjusting. This goes back to each objects center is not necessarily at 0,0,0 . A simple method is just to include a little drag button or something to indicate where to click to select an object. Here's an example:



The X file highlighing mesh is a little large. Maybe only scale it up 1 percent or less.

I added a few objects and the FPS didn't change. That makes me think that the problem is most likely in the 2d stuff. However, maybe the matrix is eating resources unnecessarily - 40X40 ? Why not reduce it to 10x10 and use a 4 grid tile? Maybe lower the screen resolution...

The save and load seem to work. When I have a bit more time I'll try the texturing and coloring.

It's funny how this is evolving from a simple "here's the barebones of a level maker that you can take and update to your needs" to a full blown app!

I've included a screen shot that shows the large object highlighting and the double toolbox.

Enjoy your day.

Attachments

Login to view attachments
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Mar 2008 00:06 Edited at: 13th Mar 2008 03:15
Thanks for that Latch - finally some excellent feedback!

The low FPS is very strange and I'm trying to get to the bottom of it.

Annoyingly, on my machine I don't have any of the glitches you mention above, so I got my laptop out which is an Intel 2.4Gig with a really bad SiS M650 GFX chipset and that gives me 23 FPS - and more importantly, all the glitches you mention!

As you can imagine, this makes writing stuff on my machine a right pain! But, as you say, with no objects on screen the FPS surely should be a lot higher than what we are getting.

Quote: "There is a problem with the drawing and refreshing of the toolbar."


Fixed that!

Quote: "I find the confirmation box when adding a primative to be a time waster. "


Gone!

Quote: "I'd also like to see a "snap to angle, size, or position option."


Already there in a fashion (try holding Shift when dragging) - but admittedly does need expanding on. When the toolbox is done I'll add it as an editable value to work with dragging, scaling and rotating.

Quote: "if the X,Y and Z limits are all open, then scaling with only the left mouse botton should occur on those allowed axes simultatneously."


Yes I agree. I added the X, Y and Z axis limiter buttons and forgot to alter all the sections of code where they were used. I'm doing that now.

I've already done the object sizing, but rotation and positioning is a little more difficult as the mouse only has two axis of movement. Therefore you can't use the LMB like you can when resizing all axis equally... well you could, but it would be useless as either two axis would be altered by the same mouse movement, or all by the same amount.

I guess the best option is using the RMB for altering the Z axis angle and position, leaving the keyboard free for the 'snap' option.

Quote: "However, maybe the matrix is eating resources unnecessarily "


I thought that too - but apparently not. The version I am using now uses a textured plain instead of a matrix and it still yields no increase in FPS!

Quote: "The X file highlighing mesh is a little large. Maybe only scale it up 1 percent or less."


Lol! I've been messing with getting that to look right myself. The scale used in the version you have is only 4/100th of a percent! I've now taken it back down to 1/100th of a percent. (I only increased it because at 1/100th on some objects the wireframe went into the object itself).

Quote: "When I have a bit more time I'll try the texturing and coloring."


Thanks - your input has been invaluable. But, try V0.5 as I've fixed a few more bits. I'll post it a little later one...

Quote: "It's funny how this is evolving from a simple "here's the barebones of a level maker that you can take and update to your needs" to a full blown app!"


Couldn't agree more. Apart from yourself, there has been very little serious interest in it so I decided to expand on it a 'little'. Once you start including toolbars with graphics, it's no longer source-only and gets more difficult to distribute.

Instead, when the program is finished, you will be able to go to the Toolbox and tick off all the object attributes you want to export and the program will create a LVL file - along with the DBA loading code to merge into your own program.

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Mar 2008 04:43
Quote: "Therefore you can't use the LMB like you can when resizing all axis equally... well you could, but it would be useless as either two axis would be altered by the same mouse movement, or all by the same amount."


Yeah it makes sense to use an "all at once" for resizing, but rotation and position probably shouldn't take that approach. Though, maybe those camera views could be put into play for multi dimensional positioning (and resizing). For instance, if you chose a top view. Perhaps automagically, x and z are available as limitable axes. Y is unavailable. Therefore you could freely move the object in x and z directions using the mouse x and y without difficulty.

If the camera view is looking left or right, then y and z become the only available axes.

Maybe this is a bit of overkill but it could help control placement better.

Quote: "I might also have to move this to the WIP board because I'm desperate for more feedback and there's not enough traffic on this board..."

I like the idea of it being here in hopes that it inspires more DBC dialog, but in reality you'd probably get more usable feedback from the WIP board.

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Mar 2008 11:56 Edited at: 13th Mar 2008 12:23
Well, here's version 0.5 - not quite so buggy.

I've still to entirely track down the cause for the low fps, but it's improved a little - on my laptop at least. It should be a bit more usable now anyway.

Hopefully V0.6 will be a little faster...

Download: http://www.computechtenerife.com/levelmaker0_5.zip (987K)

A screenshot of the program so far...



TDK_Man

Beast E Gargoyle
17
Years of Service
User Offline
Joined: 15th Feb 2007
Location: Sunny San Diego, CA
Posted: 14th Mar 2008 16:48
I'll have to download it this weekend and take it for a spin. It looks good so far, but I need to know for myself. Btw we can use it with Dbp too, right? All the best,
Beastegargoyle

Streets of Rage the best 3d beat em up ever check out the wip on apollo forums!
The Last Great Swordsmen Wip here http://forum.thegamecreators.com/?m=forum_view&t=124414&b=19
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Mar 2008 20:19
Quote: "Btw we can use it with Dbp too, right?"


Yes - all it does is let you place objects for your levels then saves a data file which your program (DBC or DBP) loads in and recreates the level.

On the fps speed issue, it looks like the cause of the problem is down to the images loaded for the toolbar. There are only 24 64x64 256 colour images for the toolbar totalling 131K but loading them does appear to have a significant performance hit.

I've disabled the V0.5 download and will be uploading a new test version shortly where you can enable/disable the toolbar and report the resulting fps for me.

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 14th Mar 2008 20:46 Edited at: 14th Mar 2008 20:52
@TDK
EDIT

Posted this when you posted the disabling the download info.

If by images loaded you mean read from disk:

Just in case you weren't aware, file operations are significantly faster when synced.

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th Mar 2008 21:25 Edited at: 15th Mar 2008 02:13
[Edit] Sorry Latch - only just noticed your last post. The images I'm talking about are embedded inside the exe itself. I'm not sure whether these are loaded when required from the file on disk, or from memory when the whole exe is loaded.

I would assume that the exe is loaded completely into memory then subsequent Load Image commands access the images in memory rather than the exe on disk.

However it's done, it doesn't appear to effect the fps whether the images are embedded in the exe or not - mainly because the fps problem is during use of the program - not when loading.

It seems that the actual loading of the images is what affects the fps.

I'm beginning to think that DBPro is the only way I'm going to fix this...

----------------------------------

OK, I've uploaded the modified V0.5 so the link will now work again. (Link a couple of posts above and the very first post in this thread).

Having rewritten a number of sections to optimize it, I simply can't get it to run any faster than this version.

This version uses an INI file which you can modify for testing purposes. By altering it, you can disable the toolbar and/or floor and rather than just turning them off, actually prevents the graphics from loading. (Note: You can still use the program with only the keyboard).

On my laptop, changing the settings in the INI file results in a considerable increase in fps - approx 22fps to 45fps.

So, if you would be good enough to test it out, I'd like to know whether on your system the toolbar is the bigger fps killer or the floor?

If I can't solve this problem once and for all, I may port it over to DBPro to see if the problem goes away...

TDK_Man

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 15th Mar 2008 10:44
Holy cow!! That editor is looking so good, I feel like giving up my project of making an editor! I thought of posting it here sooner, but I had a problem with transferring it to a computer with a network. Anyway, whoever is interested can download it here : http://forum.thegamecreators.com/?m=forum_view&t=125697&b=8

but I doubt this will ever get as near as good with TDK`s...

Good Job!

Here is a screenshot:



Thanks, TheComet

Oooooops!!! I accidentally formated drive c.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Mar 2008 10:45
@TDK
Wow! With those few changes, like the confirmation dialog boxes not appear after every single action, the multiple numeric entry options in a single dialog box, the uniform sizing when all axes are open, the interface is very pleasant to use! It's actually quite exciting!

Now down to business...
I tried running the LvEd without any alterations to the ini file. It moved along pretty well at a steady 23 fps. Sometimes 24. I turned off just the tool bar. The fps ran at a steady 50. I turned on the tool bar and turned off the floor. The fps ran at 24. Now, hold on to your chair, I turned off both the tool bar and the floor and the fps ran at a steady 100. That's right, a non fluctuating 100 fps. Why the floor off alone didn't do anything, I don't know.

Ok, with the floor off, if I click on the change floor icon on the toolbar I get a Runtime Error : ERROR 99 , so maybe that selection should be disabled if there will be no floor.

I didn't notice that there was a toggle object select with the cursor keys before. That is very handy because I loaded models with different pivot points to see what would happen, and I had trouble selecting them with the mouse alone.

Coloring worked fine. I was able to color objects without a problem. Texturing, presented a problem. I tried to load a bitmap (not from the texture folder is that makes a difference) a few times with a couple different bitmaps and I got

Runtime Error: ERROR 31

I was able to save and load an object without a problem. I tried clone object and it retained the coloring and texture. The tool/operation description at the bottom of the app is much nicer than the tips. All in all, I would say this is shaping up rather nicely. I was wondering why there isn't a BOX primative on the roster. Also, I know the level editor is still in it's earliest stages and you are trying to nail down just the basic operation but I'll throw a couple things out there maybe to rattle around in the back of your coconut:

Is there any way to distinguish between DBC versions earlier than 1.20 and the 1.20 command set? Lighting will behave quite a bit differently when one uses a level created in 1.20 vs 1.13 and < . Especially for matrixes. Also, I assume the lighting, object settings, are covered in command options that haven't been implemented yet but may have a slot on the tool bar.

Anyway, with the speed increase and a bit of the redundancy removed, this app feels pretty good.

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Mar 2008 13:45
Quote: "Why the floor off alone didn't do anything, I don't know"


It's a 'total number of images' thing with DBC then by the looks of it.

My machine just says 63fps regardless of whether I turn the toolbar and/or floor on or off, so getting results like you have supplied is impossible for me - and my laptop is just too slow to be of any use.

However, even with both turned on, you were getting around 24fps now which is acceptable for a program like this anyway - which is good news!

The floor is just a plain textured with a single image, but repeated to create a grid of 10x10 units in size. I'm assuming that's better than the equivalent effect using a matrix - purely from the reduced poly count. Once again, my stupid 63fps system prevents me from confirming this!

Quote: "if I click on the change floor icon on the toolbar I get a Runtime Error : ERROR 99"


Yes - as the INI file was only a quick hack for testing purposes I didn't alter what happened if you click on the respective toolbar icon, so that error is to be expected.

The reason I used the INI file method was because turning the floor off there results in the images not being loaded at all - rather than using the toolbar button to turn it off, which simply just hides the floor, (but the textured plain is still in memory).

Quote: "I tried to load a bitmap (not from the texture folder is that makes a difference)"


It does at the moment. I'm using relative paths for everything.

Have you noticed that when you click on Texture, the fileselector automatically shows you the contents of the Textures folder and when you load a .X file it goes to the Models folder?

This means that the saved level file can have just the filename in it rather than the full path and filename. The level editor automatically adds the correct path to the filename depending on the file type. Hence the error you got.

Quote: "I was wondering why there isn't a BOX primative on the roster."


Not sure what you mean there. For a box, just press 'B' or click on the first primitive on the toolbar.

Quote: "Is there any way to distinguish between DBC versions earlier than 1.20 and the 1.20 command set?"


Good question - to which I don't know the answer. I don't know if it's that important really as I'm using it to create the editor and anyone who doesn't use 1.20 just wouldn't use those options (when they are added).

Quote: "I had trouble selecting them with the mouse alone"


Yes - I've played with that and although better than before it's not as good as it could be because of the limitations of DBC. But, if I continue with it in DBC I'll switch to using Sparky's which should solve all the problems.

With respect to that problem I also made a couple of alterations to improve things:

1. There's now a timer when you click the LMB. A quick click registers as a 'select' whereas holding down the LMB registers as a 'drag'. (Before, any attempt at dragging an object instantly registered as a select click and invariably ended up selecting a nearby object when you didn't want to).

2. When you single-click on an object in close proximity to another, using the 'select' method outlined above, you can't select an object if it is already selected. So, clicking on two objects in the same location will now alternate between the two objects. With the timer, holding down the LMB will start dragging/rotating/resizing the currently selected object without selecting the other object at the same location.

If all else fails, as you say, there's always the cursor keys...

As it is entirely usable with just the keyboard and doesn't need the toolbar, I can always keep the INI file and add the ability to disable it on the options screen for people who have machines which it struggles on.

All in all though, good news so thanks for your time testing it out for me.

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 15th Mar 2008 20:30 Edited at: 15th Mar 2008 20:47
Ran a few tests on a matrix vs a plain in terms of texturing. A 10x10 matrix was slower than a 10x10 scaled texture on the same size plain/matrix at camera distances where the entire meshes were visible. But get this, the closer the camera is to the matrix, i.e. the less of the entire matrix that is seen at once, the higher the FPS. With a plain, the closer the camera, the lower the FPS. My assumtion is the areas out of the field of view of the matrix aren't rendered because of the multiple polygons. However, with the plain, everything is being rendered including the repeating texture because the 2 polygons are always in the FOV. So, at certain rotations and distances, on a 1000 unit matrix vs plain, the matrix out performed the plain.

Quote: "Not sure what you mean there. For a box, just press 'B' "


I suppose I mean this: While there is the cube primative that is 10x10x10 units, there is no box object where the dimensions are flexible. This brings me to another concern. None of the dimensions/sizes of the objects seem to be flexible unless I'm not understanding the method of sizing. I must admit, I am assuming the sizing method is just scaling.

I see a problem with scaling on a few fronts.
1. collision boxes do not scale
2. the size reported back by DBC doesn't change
3. if one scales and then makes a new mesh out of the object, the above two concerns are addressed, however, if the object has animation then the animation is gone and if the object had multiple textures as in an x file or 3ds file, then it can't be retexured properly. There are a couple of ways to handle the X file object with memblocks and what not, and in general there's no real way around the sizing issue of the X file except with scaling.

Perhaps you've already addressed these concerns. Maybe the export file creates objects of a new size instead of scaling them up.

Oh just another thought, maybe include a play/loop animation control for testing purposes.

I know you've put a lot of work into your tool bar gui system, but if you could have it, would you want a win32 api set of controls? That would mean running the app in windowed mode - it might kick the speed up a bit because of windowed mode and because of relieving the 2d graphic burden.

Enjoy your day.
Sinani201
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 15th Mar 2008 21:19
Quote: "I doubt this will ever get as near as good with TDK`s..."

Maybe, but don't be discouraged by that comment. Keep trying!

Seriously, how do you make the little blue text come up below your message?
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 16th Mar 2008 02:31
Working from your comments regarding plains v matrices, the current version now uses a 16x16 grid of 10x10 plains - each with a non-repeating texture of 256 colours (10x10 pixels in size).

So now, when zoomed in, there's no longer just one huge multi-textured plain always being drawn. This should help with the fps side of things...

Quote: "While there is the cube primative that is 10x10x10 units, there is no box object where the dimensions are flexible."


But a cube is a box, but with all sides the same dimension. When you create a box, it's just the default 10x10x10 size, but it's not fixed - you can set the width height and depth to whatever you like. It didn't seem worth creating two buttons on the toolbar for what is essentially the same thing.

Maybe I'm not properly understanding what you mean...

Quote: "None of the dimensions/sizes of the objects seem to be flexible unless I'm not understanding the method of sizing."


What do you mean by flexible? The sizing is in 3D units. So if you stretch/resize a default 10x10x10 box to 40 wide (X), 30 tall (Y) and 5 deep (Z) then the object will be created that size in the user's program (using the supplied load level function).

The 40, 30 and 5 correspond to the size of the object and nothing to do with the scaling factor. So, that object's size data is stored in the level file as X=40 Y=30 Z=5 - not X=10 Y=10 Z=10 and three scaling factors.

Are you suggesting that the ability to scale an object is necessary - ie 200% will double the size of a box to twice it's current size?

Quote: "I see a problem with scaling on a few fronts."


I'm fairly sure your points 1 and 2 are covered by the fact that object's sizes are saved, rather than the scale factors.

As for point 3, that's something I've not looked at yet so I don't know what problems I'm in for!

Quote: "maybe include a play/loop animation control for testing purposes."


Good idea. Added to my list of things to do!

Running the program in Window mode is still an option - and would still increase the fps even using my GUI functions. I can make it an option.

I'll finish this version off and add Sparky's and see what the end result is like. I still haven't ruled out moving it over to DBPro.

I am a little disappointed though that no-one else so far apart from you has been willing to try it out and let me have some fps figures for more recent versions of the program.

So, thanks for your efforts on that score...

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Mar 2008 19:44 Edited at: 16th Mar 2008 19:45
Quote: "What do you mean by flexible? The sizing is in 3D units"

I guess it was an extremely long way of asking "is the exported sizing in units, or is the export information the scale factor"? And since the export is the actual unit size, then no worries; except for animated x files which probably would have to have the scale factor information exported so the animation isn't destroyed by the make mesh from object command.

As a thought as I'm writing this, if you want, I could put together a function for creating grids. It would be simple - not a whole lot of fancy options - and I could include a randomization for x,y and z that is controllable through the function so it could be distorted if one wanted.

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Mar 2008 00:01
Here's V0.6.

Object selection is now pretty good and fixed some of the causes of runtime errors in earlier versions.

This will probably be the last update in this thread as I think it's now good enough for a WIP thread.

http://www.computechtenerife.com/levelmaker0_6.zip (1MB)

TDK_Man

Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 20th Mar 2008 02:06
Nice editor! I downloaded, the editor was nice and easy to use, save for a few problems.

First of, I loaded in the test level, and selected the sphere, but the wireframe was a cube, same problem with the sphere, but x models work fine.

Scaling works perfectly for me, but selecting does not, I moved a model to the left side of the screen and had no luck selecting it again.

It ran fast enough here, hovering from 30 to 60 fps staying around 40 mostly. Though when clicking repetitively fast it slows to 20 fps.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Mar 2008 02:28
Quote: "and selected the sphere, but the wireframe was a cube,"


That's correct - it's only .X files that are not highlighted with a box to keep the poly count down - it is DBC remember!

Quote: "Scaling works perfectly for me, but selecting does not"


You need to do a quick left mouse click to select an object. Hold it down too long and the program thinks you want to drag. V0.6 works fine - I've been testing it out most of the evening.

It works on a timer, so it should be the same on machines of all specs, though the delay time may need a bit of tweaking. It's set now on what I found to be a comfortable delay.

TDK_Man

MEE
16
Years of Service
User Offline
Joined: 3rd Mar 2008
Location: salem OR
Posted: 20th Mar 2008 06:10 Edited at: 20th Mar 2008 10:00
Hi TDK

I've been working on a basic level editor my self.
I'm kind of A noob but if any of my code can be of help to you
then feel free to use it.

I'm particularly proud of the camera movement.


well here's my entire program so far
(here's hoping this actualy goes in a code snipit
this is only my second post.)






Why do we BAKE cookies and COOK bacon?
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Mar 2008 07:46
@TDK
Something that may help speed up your gui functions a bit... I noticed you use a lot of Select Case statements (unless you've rewritten them and changed this). A problem with Select Case is even if the condition is met, the program still looks down the list of cases. You can avoid this and get a substanital increase in speed by using the dreaded goto command. Here's an example using a jump method to the endselect statement and one without. On my machine, the following code runs 200% faster with the jump to the endselect even though the case is matched on the first check:

Code with goto endselect


code without goto


Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Mar 2008 10:20 Edited at: 20th Mar 2008 10:52
MEE:

I edited your post to put your code into a code box - your method didn't work!

When you have pasted code, simply highlight it with the mouse and click on the Code button. That's all there is to it.

As for camera movement, your code doesn't appear to allow you to select objects by clicking on them with the mouse - the main reason that I can't just drop any old camera movement code in my editor.

My editor uses the cursor keys to cycle through the objects and if the select with the mouse option wasn't available I could use any camera movement method.

Latch

Sorry - I forgot to reply to your offer of grid code in your previous post. I meant to ask what you meant. Were you talking about the floor grid?

As for the Select Case, I'll look into that. I don't really want to use Goto, but I'm quite happy to lose the Select..Case if necessary - it's a nuisance anyway as you can't nest them, so some have been replaced with If..Endifs already. Definitely interesting...

As you already know, I can't see the effects of any changes I make fps-wise and I can't expect you to live on here and test each version the moment it needs testing - hence the reason for starting a WIP post.

If there is still no interest I may build a machine just to test it on myself this weekend.

[Edit] Oh yes, by the way Latch - is selecting objects with the mouse any better now? (Don't forget that you use a quick single click with the LMB to select and hold it down to drag the selected object - regardless of whether the mouse is over the selected object or not).

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Mar 2008 19:55
Quote: "As you already know, I can't see the effects of any changes I make fps-wise "

That's why I output the benchmark in terms of timer ticks for the programs so one could see how long it's actually taking to run the Select commands.

Quote: "Oh yes, by the way Latch - is selecting objects with the mouse any better now"


It is, actually. Are you using Sparky's DLL for a collision check like the demo?

Quote: "I forgot to reply to your offer of grid code in your previous post. I meant to ask what you meant. Were you talking about the floor grid?"


Not for the grid floor... I guess I was thinking more about a complete level and environment/object editor where you could create and place custom objects. A floor or wall, for example, that is made up of a grid instead of a repeated textured plain, would allow for more subtle lighting effects, like a torch/flashlight, rough surface, etc.

As I think about it more, I can't think of how you would be able to export the grid in the level file. You'd have to have the function available in the user's program, or it could be exported as a memblock but then the user has to have an enhanced version of DBC and have to be able to deal with memblocks. I also thought of creating a direct x file, but then the number of exports and imports just gets complicated.

Ultimately, a game engine that went along with the editor would be pretty nice. Any custom libraries, dlls, or file types would be part of the engine. The level creator would export the necessary data to engage the engine... I think that's more where my head was at. Maybe in the future once the level creator is stable.

Quote: "I can't expect you to live on here and test each version the moment it needs testing "

Of course not! And your only getting information from a limited number of perspectives which is not as helpful as multiple perspectives. Anyway, I did run a couple of tests on this new version.

It is a little slower than version 5. It runs at about 19 to 21 fps on my machine. The unviersal sizing needs a little adjusting I think. I loaded the GI model from the DarkMatter demo. When I sized it (all axes at once) it got scrunched on the y axis.

I ran into something similar in an animator I was working on and it seems to have to do with the frame matrices and the animation scaling keys in the direct X file. The objects apparent size is a combination of it's vertices, the scaling in the frame matrices, and if there is an animation set, the scaling keys in that. Depending on how you're doing the sizing, this may or may not be the case here, but I thought I'd provide the info in case it's useful.

Enjoy your day.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Mar 2008 20:55
The results from your two code snippets were interesting:

1st: 110

2nd: 234

But...

That's only when A=1. When A=5, the first snippet leaps up to 234 - exactly the same time taken by the second one - which also still takes 234ms whether A=1 or A=5!

So, the only advantage in speed gained using Goto is when someone clicks on the earlier buttons on the toolbar.

Incidentally, if you remove the Select..Case and just use 5 If..Endifs it results in a score of 188. If the loops are nested, it gives me:

A=1: 78
A=2: 125
A=3: 156
A=4: 187
A=5: 203

But I now have 30 buttons, so that's going to be substantially slower!

So it's all rather confusing!

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Mar 2008 00:02
There's no doubt the select is broken, but that goto will shave some time off, the earlier the case condition is met. An alternative of so many if thens... yup, what can you do? Well I know you hate the thought of it but, if the IF THEN is a little faster, combine that with a goto or perhaps a return from a gosub and the linear testing of all the elements might be eliminated (at least when the condition is met).

I guess at least in the case/goto scenario, without the goto you are guaranteed that each case will be looked at and eat up the full amount of time it takes from top to bottom; and with the jump, you can get around all that testing. Same holds true for the IF THENs.

Enjoy your day.
Stig Design Stig Magne
18
Years of Service
User Offline
Joined: 23rd Mar 2006
Location: Norway
Posted: 21st Mar 2008 00:19
I tryed your level creator TDKMan i havent get enny problemes with the fps or enny other isue`s Ceep upp the good work

Stig Design (Free Games,Sources,Textures,Photo`s)
Lisence Free at http://dashboard.filefront.com/StigDesign/
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Mar 2008 01:27
Here's what I'm currently struggling with - if anyone can help...

I've spent so long on this, my brain is turning to mush and I'm sure it's now simply not firing on all four cylinders. So, it's bound to be something so very, very stupid I can't see it for looking.

I thought I knew how NewXValue, NewYValue and NewZValue worked, but I simply couldn't get it to do what I wanted. I checked the help files and wish I hadn't - what it tells you is so unhelpful.

So I switched to using Sine and Cosine (which I always thought was what NewXValue and NewYValue were replacements for) and it does the exact same thing.

I've produced a small snippet. What you are supposed to do is hold the LMB down and move the mouse left and right. The camera rotates around the sphere in the centre of the matrix.

If you then use the scroll wheel, you can zoom in and out and if you then hold the LMB and move the mouse again, it should rotate around the sphere from the current camera position.

This it simply won't do. In fact, if you click the LMB (even without moving the mouse) the camera jumps a small amount until it gets to X=0 Z=0.

It's as if the radius of the orbit is being reduced every time you start a rotation of the sphere.



Can anyone tell me what really stupid error I'm making please?

TDK_Man

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Mar 2008 01:55 Edited at: 21st Mar 2008 01:57
I don't have a scroll wheel and I think I deactivated the functioning of it from my mouse, but I think I know what is wrong.

You are adjusting the radius each iteration with



As you change the angle, to maintain a constant radius, x and z both decrease and increase at a rate determined by the trig. They are only equal to the radius when the are exactly at 90 or 0. In between, they have different values so you are assigning the radius to a decreasing value each time you click on the button if the angle is not 90 or 0.

I suggest getting rid of the above code. When you use the mouse wheel and move the camera, recalculate the radius using the distance formula from the sphere to the camera.

Enjoy your day.
Jmahmood
17
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 22nd Mar 2008 06:46
Fantastic job tdk.
I have mailed you about the source code..But it turns out that your mailbox is full so my msg was not sent.

You said the level maker is open source,Can u give me the level makers source code along with the media files. There are some cool features i've seen in your level maker which i can add to my software RTM.

Anyway,I've seen a bug in the level maker,It shows a runtime error when i try to texture an object.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Mar 2008 05:53
You need to read all the posts in this thread - a few things have changed since I originally mentioned 'open source'.

Basically no-one was interested in this program so instead I decided to turn it into an application with media and options screen which users can customize the output of a level to suit their own programs.

Even if it was still open source I wouldn't have released it until it was finished to a level I was happy with - which it isn't!

Thanks for the info about the mailbox - I'll check it out. You can use the new email address which is exactly the same as the old one, but tdk_man2 instead of tdk_man.

I've seen a bug in the level maker,It shows a runtime error when i try to texture an object.

That's possibly because you've not seen the info in the previous posts or read the text file that comes with the program.

TDK_Man

Jmahmood
17
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 23rd Mar 2008 12:50
TDK,
Can u help me with something?
How are you saving the scene in your level maker and loading it back.

I know you saved values in a text file but how did u save it?
It would be great if you explain the loading and saving process.

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Mar 2008 21:55
All you do is decide what variables to save, like X, Y and Z position, object type, X, Y and Z size, colour/texture and so on. In other words all the values you would need to use with the DB commands to re-create the scene.

TDK_Man

Login to post a reply

Server time is: 2024-05-02 10:27:16
Your offset time is: 2024-05-02 10:27:16