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 Professional Discussion / Asset creation toolage

Author
Message
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 5th Dec 2010 01:35 Edited at: 5th Dec 2010 01:35
So I've kind of hit the point where I want to redesign my asset creation tools (right now just a room builder) before I continue with more work on my Text RPG itself (I kind of need a world to walk around in to start coding other stuff and testing it).

I want to make it as streamlined as possible, but current if I want to change something I would have to go back and redo an entire piece of data for a room.. Not too much of a problem except where room descriptions are concerned. Having to retype an entire room description to fix a typo.

I was thinking having a basic GUI layout probably wouldn't hurt much, although this could probably be a text-only affair as well, with some basic graphics making some boxes on the screen where the different data would be displayed from whatever variable/array is holding it.

However I'm not sure how to approach an editable text box tool, where you can move the cursor freely and then delete from that new point, or insert additional characters to fix or add to something, etc.

I suppose I do have idea about how I might want to approach it, but I'm concerned it would be overly bloated code with lots of conditional checking and not very efficient. So short of effectively starting my own GUI library for this project (not desired! lol) I was hoping someone might have a basic example of how this kind of functionality could be accomplished.

I'm almost wondering if I shouldn't grab DarkDGK (its free now right?) and VC++ express and whip up some kind of GUI that way (saves worrying about the details of creating edit boxes etc).. Can Matrix Utils be used in that manner? As I'm gonna be using the array saving/loading functions for my game.

Anyway if there are any helpful thoughts on either doing it through DBPro alone or a free decent GUI library for DBPro, or GDK, etc.. Kindly appreciated.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Dec 2010 09:51
Quote: "I want to make it as streamlined as possible, but current if I want to change something I would have to go back and redo an entire piece of data for a room."

Use a text editor instead and maintain a text file or set of text files for your 'rooms' - not all of your tools need to be programs written in DBPro.

You can then either load these files directly into your game at startup time, or if you want to continue to use your existing array-based code, write a short program to take these files, build your arrays from them, then save these arrays to disk (basically, a 'compiler' for your rooms).

Quote: "editable text box tool"

I'm sure that someone has at some point - I have written code to edit text in the past, but not with the point/click functionality. Hopefully one of the GUI people will post here at some point and show you the way.

Quote: "Can Matrix Utils be used in that manner?"

No, my plug-ins don't work with GDK. With the little I know of what you are doing, DBPro still sounds like the right way to go.

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 5th Dec 2010 15:33
To start with I would simply uses left right arrow keys and delete to go through your text string length one character at at time and position a cursor at the appropriate place in your text. Still, things like this make you wish there were a couple of visual basic tricks in DB, like a form editor.

http://s6.bitefight.org/c.php?uid=103081
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 5th Dec 2010 21:07 Edited at: 5th Dec 2010 21:08
Hmm, yeah. Like most things the whole "just make a compiler to parse a text file" came to me after I posted. I may just go look into that way for the time being.

Although it would be interesting to see it done in DBP all the same. Maybe one day in the future


Ian, if you have link to the code you are talking about I'd still be interested in looking at it. It may not necessarily need Point N Click functionality, if it has a viable navigation method (TAB key?)

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Dec 2010 21:46
The text editor I mean is called 'notepad'

Although I don't know exactly what you mean by 'text rpg', I'm guessing it's something like a more dynamic text adventure - if that's the case then something like the following format could be used.

large clearing.txt


brook - east bank.txt


... and so on. Everything is simple to read and write, it's in plain language, with no special numbers to remember, and it's very simple to parse into your data structures.

All your compiler needs to do is verify that all required tags are present when it reads the file content, verify game specific information is valid (eg, object names are known and not duplicated), match the location names to the location id's you've allocated, and then write into a file the array containing the collected information of all locations.

Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 5th Dec 2010 22:09 Edited at: 5th Dec 2010 22:11
Well I don't want to get into rehashing debates on data storage and how my structures are set up. But staying on the parser idea.

I'm gonna go consult some help files and maybe try to find a thread or two on parsing files with custom formats/tags etc. I don't plan anything exotic, but just some simple tags to denote which part of a room everything belongs to and then throwing that into the appropriate data container.

I have very little experience with reading/writing files directly, and the most complex thing I ever did was a python script that read some data and did some stuff with it based on what the data was.

So while I'm trying to teach myself let me propose a teaching moment.

We'll say I have a text file that looks like this. I can refine the format later, but just want to present a "this is how you would parse this" scenario if anyone feels obliged to write an example..



Ah...yes, a little verbose but just an example with something I am familiar with (tag based formatting). I like the idea of tags because I am the kind of person who will easily get confused about stuff that needs to be in a specific order (like the exit locations) but I can see coming up with a template of whatever, and then making it some kind of shorthand.

I thought about using an INI or XML plugin but even getting that stuff setup seems like a rather long affair, or I misinterpreted what I was browsing through..

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 5th Dec 2010 23:24 Edited at: 5th Dec 2010 23:28
There are plenty of XML editors (as your example data structure) that you could create the source text in. Then as IanM said, write a compiler to convert the text into a final data structure for your game to use. You can create indexes, encrypt the text and other processing to make the final datafile portable & convenient for your game while still making the source text easy to edit and human-readable.

edit: Re-read your post and missed the fact that it's the compiler/interpreting part you wanted help with. It's definitely one nice perk of using higher level/web languages that XML is really easy & convenient. The XML plugin dosen't look that bad, have you tried it?
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 6th Dec 2010 00:00
I haven't yet.. I could be wrong but I thought there were 1 or 2 of them floating around.. If so did you have a particular one in mind to look at?

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 6th Dec 2010 00:14
I tried the plugin from this thread and it compiled and ran the example fine. Looks easy to understand if you're used to XML in other languages.

http://forum.thegamecreators.com/?m=forum_view&t=123023&b=18
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 6th Dec 2010 00:28 Edited at: 6th Dec 2010 00:31
That is the one I came across too. I'll probably look into that one.. Although I think Styx has some XML features as well -although I am loathe to install it because even if "nothing is really wrong" I hate those stupid compiler warnings about naming conflicts, etc :p

But I still wonder about the merit of just using a simple "open file and stop to read when you hit certain indicators" type deal.

I was thinking of adapting the colored text parser I got from my colored text thread, to open a file and read the file by word, using predefined tags as delimiters.

XML is nice and really good for holding data but I wonder if it isn't overkill in this case as well? I could see using it for doing an entire game, but right now I just want something fast and easy to play with to get data into my engine so it can be manipulated, tested, and other concepts can be worked out - before I really begin to write a my Story based RPG.

I suppose I was (as usual) a little unclear on that part. A fast and dirty parser will work for rapid prototyping in this case. But I definitely see value in using some kind of XML based tool in the long-term for generating an entire game worth data.

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 6th Dec 2010 00:51 Edited at: 6th Dec 2010 00:53
Personally, if I was developing a game that needed the kind of data structure that a text adventure needs I would do something like this:

While developing:
Load XML datafile
Parse into your own arrays etc
Start the game

Closer to completion:
A seperate program to load & parse the XML
Save it in a format easy to re-load into your arrays

Also, I would be tempted to use a storage method that seems overkill for the initial design concept because it's much easier to expand structures later rather than have to re-design the whole database format.

Like you said, you could use something as simple as data statements initially while you work on the bare framework of moving around rooms, dealing with objects etc. Just looking at the text adventure tutorial shows how quickly structures can become `deep` and hard to relate.

I certainly would try and use existing tools and data types, nothing worse than re-inventing the wheel!
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 7th Dec 2010 19:28
I'm thinking in this case it will probably pay to just do the parser now.

I don't need to worry about a saving/loading format (for this particular data) as I'm using Matrix Utilies' typed array saving function (so it'll spit out a funny looking text file) and reloading it is as simple as using the load command to load everything back into the array.


I appreciate all the input from people. It's helped me to slow down a bit, and spend time writing the tools properly. Although I hopefully one day will get to write some kind of GUI based editor, as I intend the engine to be reusable to a large extent (essentially plug n play w/data files)

Login to post a reply

Server time is: 2026-07-21 19:18:59
Your offset time is: 2026-07-21 19:18:59