RTC in a Text Editor

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

RTC in a Text Editor

Post by ebeneezergude »

Obviously, the RTC dungeon text file holds all the detail for the dungeon, whether it be a custom dungeon or standard. I've found a lot of work can be done in the text file without actually having to go into the RTC editor - in some ways it can be easier to manage creating wallsets, adding bitmaps, etc by editing directly in the text file.

So, does anyone have any good tips or recommend any good text editor applications that help manage the process and make it faster / easier?
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: RTC in a Text Editor

Post by Sophia »

Oh, the memories. :mrgreen:
Back in the (not so) good old days, this was the only way to build an RTC dungeon.
My first dungeon, Reactor, was 100% hand coded-- there simply was no editor at the time. I used Wordpad, which I'd not actually recommend.
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Woh...Wordpad...! I remember that....! Wow...building an entire dungeon without a map editor? That's properly, impressively, hardcore....

Interestingly, it's probably also how the FTL team originally built DM and CSB back in the day. I wonder how they actually put them together? Is there any historical record or interviews with the team on this?

I guess I was after something that could be used to colour code different bits of text, format various lines of 'code' in clean ways, and generally allow me to control the dungeon file in a more efficient manner than is possible using the standard windows text editor, without having to resorting to the RTC editor for manual inputs of graphical assets or object creation, which is quite fiddly and time consuming.
User avatar
Chaos-Shaman
High Lord
Posts: 2642
Joined: Wed May 03, 2006 7:26 pm
Location: The Gates of Hell

Re: RTC in a Text Editor

Post by Chaos-Shaman »

yes, it can be time consuming ebs, but here is how to take advantage of it, once the painstaking prototype of what you're creating is done, make sure it is on a single tile, copy the whole damn thing, just replace the unique triggers, counters and actions. I end up getting it all down in the mind, creating all the unique stuff first, like an assembly line idea. it's rather fast once you get the prototype done. methodology ... it is really no different from line programming, except it's icons. most of it is the same principle, create the mechanic, dupe it for say all characters as an example and change to their unique values, it's fast once you get the hang of it, like everything.
keep your gor coin handy
User avatar
terkio
Mon Master
Posts: 937
Joined: Tue Jul 10, 2012 8:24 pm

Re: RTC in a Text Editor

Post by terkio »

ebeneezergude wrote: I guess I was after something that could be used to colour code different bits of text, format various lines of 'code' in clean ways, and generally allow me to control the dungeon file in a more efficient manner than is possible using the standard windows text editor.
Notepad++
"You can be on the right track and still get hit by a train!" Alfred E. Neuman
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Chaos-Shaman wrote:yes, it can be time consuming ebs, but here is how to take advantage of it, once the painstaking prototype of what you're creating is done, make sure it is on a single tile, copy the whole damn thing, just replace the unique triggers, counters and actions. I end up getting it all down in the mind, creating all the unique stuff first, like an assembly line idea. it's rather fast once you get the prototype done. methodology ... it is really no different from line programming, except it's icons. most of it is the same principle, create the mechanic, dupe it for say all characters as an example and change to their unique values, it's fast once you get the hang of it, like everything.
I really wish I had your understanding of RTC. From what you describe I think I understand in conceptual terms, but I don't have the knowledge to test it myself in RTC. I think I get the prototyping idea as you mention, in the sense that I've built most of the 'props' for my project.. but still, these are wallsets, wallitems, objects, etc, not fundamental dungeon mechanic 'logic' items.
User avatar
linflas
My other avatar is gay
Posts: 2445
Joined: Tue Nov 04, 2003 9:58 pm
Location: Lille, France
Contact:

Re: RTC in a Text Editor

Post by linflas »

Notepad++ and for example, select Language > P > Properties.
"The only way out is another way in." Try Sukumvit's Labyrinth II
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Hey Linflas and Terkio, just checked out Notepad++. It's brilliant, exactly the sort of thing I was after. Thank you so much.
User avatar
Chaos-Shaman
High Lord
Posts: 2642
Joined: Wed May 03, 2006 7:26 pm
Location: The Gates of Hell

Re: RTC in a Text Editor

Post by Chaos-Shaman »

I really wish I had your understanding of RTC. From what you describe I think I understand in conceptual terms, but I don't have the knowledge to test it myself in RTC. I think I get the prototyping idea as you mention, in the sense that I've built most of the 'props' for my project.. but still, these are wallsets, wallitems, objects, etc, not fundamental dungeon mechanic 'logic' items.
hey, whatever works best for ya ebs. cutting and pasting wallsets are not so terrible :mrgreen: either way it still has to be done.

I wonder what a speed test at what would be faster, line or icon programming? if one comes up with an idea. I have doubts that line programming is any faster :) all I know is you have some kickass wallsets, nice work. any idea when you'll have a dungeon put out?
keep your gor coin handy
User avatar
terkio
Mon Master
Posts: 937
Joined: Tue Jul 10, 2012 8:24 pm

Re: RTC in a Text Editor

Post by terkio »

The essential point is not speed.
GUI editors are limited to what the editor designer did designed.
Line coding gives access to all that is possible.

It is not a matter of what is better. They are complementary programming tools.
"You can be on the right track and still get hit by a train!" Alfred E. Neuman
User avatar
Chaos-Shaman
High Lord
Posts: 2642
Joined: Wed May 03, 2006 7:26 pm
Location: The Gates of Hell

Re: RTC in a Text Editor

Post by Chaos-Shaman »

yes, I agree on that, either way they are interchangeable. a combination of both is probably the best way. speed is important though, so is ease of use. to tweak a dungeon design is probably best done in line code, to slap together thoughts\ideas is probably done best with a GUI.
keep your gor coin handy
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

I personally find designing the dungeon with a GUI is essential for my way of working. But I find in certain instances inputting graphics and elements into the editor way faster using the text editor than doing it through in-editor dialogues. Inputting new graphics into RTC can be very tedious, and the wordpad just cuts out alot of the fuss.

In terms of when dungeon release? Am currently finishing off the overall layout and structure of the dungeon, then will go into more detailed design for each area. But not releasable any time soon... I think I made quite a big job for myself!
User avatar
Chaos-Shaman
High Lord
Posts: 2642
Joined: Wed May 03, 2006 7:26 pm
Location: The Gates of Hell

Re: RTC in a Text Editor

Post by Chaos-Shaman »

you got that right, I know it. tends to be the more one learns the more we want to do, improving on what was already done because there is a better way.
keep your gor coin handy
User avatar
terkio
Mon Master
Posts: 937
Joined: Tue Jul 10, 2012 8:24 pm

Re: RTC in a Text Editor

Post by terkio »

How large is your dungeon ?
"You can be on the right track and still get hit by a train!" Alfred E. Neuman
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Am currently designing with 105x105 sized levels. There is a grid drawn onto each level splitting each level into thirds (ie, 3x3, or nine boxes), which crudely aligns to the various areas and locations matching the sketch design of the dungeon structure. This also aligns to a basic 3d model I've made to help understand the dungeon spatially, also using the 3x3 grid for each level. This is like a 3d version of the sketched design.

In wordpad I could cut and paste a level layout with the grid, thereby quickly creating many "blank" levels with the grid drawn on. RTC automatically picks these up and numbers them accordingly when it re-interrogates the text file upon opening and automatically formats the text file. In this way, I could propogate the grid onto all levels quite quickly. Just had to mop up with the Item Identify pre-fix semi-manually in the text file with a bit of search and paste.
Last edited by ebeneezergude on Sun Apr 06, 2014 9:13 pm, edited 1 time in total.
User avatar
terkio
Mon Master
Posts: 937
Joined: Tue Jul 10, 2012 8:24 pm

Re: RTC in a Text Editor

Post by terkio »

Notepad++ has "macros", I guess you can automate your level splitting with a macro.
Notepad++ allows supporting one' s own language.
Hope that can help and eventually be made available to the DM community.
"You can be on the right track and still get hit by a train!" Alfred E. Neuman
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Having now played with it a bit today, I can agree that it is a really good bit of software. Very, very useful. Not just for DM projects, but for a whole range of other things. I like the way you can 'collapse' the code for each section. Very handy when you have a very long text file. It would have been really good if GG allowed for splitting out the text file into individual files, but this is a neat way around it.
User avatar
Seriously Unserious
Master Superior
Posts: 1418
Joined: Sun May 11, 2008 11:53 am
Location: Wandering around aimlessly in Lynchgate Woods
Contact:

Re: RTC in a Text Editor

Post by Seriously Unserious »

I can also attest to how handy notepadd++ is. I've used it for many things, but the most common thing I've used it for was hand coding websites, with html, css, php and javascripts when studying web development in College. It's great for editing simple text files when you need something more advanced then notepad but don't want any fancy formatting codes as a full word processor would insert into your file, messing up code. I also love the way it colour codes functions and other blocks of code and makes them collapsible.
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Hey Terkio and Linflas, a question for you: in notepad++, I want to make the recurring level entry line

; Level

become a foldable part of the code. Ie, so I can fold away most levels except one I want to look at directly. Is this possible do you know? RTC calls off each level in Layout as

; Level 02

...for example. I'd like to be able to collapse each level layout in the text file.

Thanks :-)
User avatar
Seriously Unserious
Master Superior
Posts: 1418
Joined: Sun May 11, 2008 11:53 am
Location: Wandering around aimlessly in Lynchgate Woods
Contact:

Re: RTC in a Text Editor

Post by Seriously Unserious »

I just checked the help files, and it turns out you can, by creating a user defined language. Here's a copy of the text:

Code: Select all

User Defined Languages

User defined languages allow you to add your own language to Notepad++. This is a very quick and easy way to do so.

The NpWiki++ page about user defined language files lists all known such languages and allows sharing new contributed files.

Notepad++ always has the main User Defined language available. You can use this to test your settings and then later on create a new language based on this. The User Defined language gets reset each time you restart Notepad++, its settings will not be saved. User defined languages are available from the bottom of the language menu.

To define one, you need the User Defined Dialog, which can be accessed by selecting View->User Define Dialog... or pressing the  button.

The dialog can float like any regular dialog when open, or be docked in the main Notepad++ window. Simply click Dock/Undock to do so. If the dialog is undocked (floating) you can control its transparency. Enable the transparency checkbox and control the amount using the slider. Note that transparency is only available on Windows 2000 and later.

The dialog shows a dropdownlist of the currently defined user languages. Select one to change its parameters, if possible they will be automatically saved. To create a new user language based on the current state of the main User Defined language, click the Create New... button, a dialog will pop up asking for the name. To create a new User language based on the currently selected language, click Save As... and enter the new name. If you have selected an user created language, you can click on the Rename button to enter a new name if necessary, and the Remove button will delete the language.

If you want the user language to ignore the case of the text (so it will be case insensitive when looking for keywords), enable the ignore case checkbox.

For user created languages, you can also define what file extensions to associate with them for language autodetection in the textbox with the Ext label.

Most settings have a certain text style associated with them. These work the same as in the Styler Configurator (see Styler Configurator for details).

Other aspects of the language are controlled by the settings divided in four groups:

Default style and Folding (Folder & Default tab)

This tab control the style of the default text (text that has no special attributes or meaning) and the keywords that control the folding. A keyword in the Folder Open group will trigger a new Fold group that can be expanded and collapsed. A keyword in the Folder Close group will close any opened group.

 

Keywords (Keywords Lists tab)

This tab controls what keywords are registered with the language. You can define up to four groups of keywords, each with their own style. If you enable the Prefix option for a group, that means that these keywords can be prefixes of entire words, and thus will be detected even if the keyword is directly followed by other text. In that case the other text will be styled the same as the keyword.

 

Comments/Numbers (Comment & Number tab)

This tab controls the behavior and appearance of comments, and the appearance of numbers. You can define multiple comment symbols that are comment line symbols. These comments run from the symbol itself to the end of the line. You can also define comment block symbols. These symbols start commenting from any comment open symbol, until and comment close symbol is reached.

If you enable the Treat keyword as symbol checkbox, the comment symbols also trigger comments if they are the beginning of a word, much like prefix keywords.

Numbers are only recognized if they start a word with characters ranging from 0-9, where only the number symbols are styled as such.

 

Operators and Delimiters (Operators tab)

This tab controls what operator symbols exists and what symbols act as delimiters. Operator symbols are characters that split two words. They behave much as whitespace but can be styled differently.

Delimiters are single characters and usually defined in pairs. Any text between a pair of delimiters as styled as such. A good example is a string, which is delimited on both sides with double quotes and drawn in a different color. Since, in many languages, a string may contain the string delimiter with a special prefix, you can enable and choose this prefix, the escape character.

 

Storing and sharing user define language definitions

Basically, the settings for all user defined languages are stored in a configuration file called userDefineLang.xml. This is handy when you have defined only one language, or when you want to share all of the languages you defined. Because this scheme is too coarse grained at times, you can also

Import a language from an external file, as long as it has proper contents. Changes will be saved in your file for all languages.
Export an individual language to an .xml file.
Note that the Save As button does not create any new file. It duplicates the current language using a new name you supply. Export does create a new file. Likewise, Create New creates a new language with all attributes reset to default and the name you provide.

Please also note that, if you import a language you already have, you will get duplicate entries in the language list and in the language menu.
I hope that helps. Please let us know how this goes...
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Hey SU, thanks, yeah I'd seen that, but couldn't make it work. I can only seem to fold the first part of the text, not fold text successively. not sure what I'm doing wrong. Try folding character ';' for example, does the trick up to the first ';', but can't view text after the first ';'.

The P>Properties language seems to fold the '[' and ']' characters, but I can't replicate that.

I'm not a code person, so I just might be being a bit thick - I don't understand how it works... :shock:


EDIT: 2 : Ok, worked out a bit of it, now does what I want....

Folding in comment style:
Open: Level
Close: ;

Folding in code 1 style:
Open: */
Close: /*
Last edited by ebeneezergude on Sat Apr 12, 2014 9:26 am, edited 1 time in total.
User avatar
Seriously Unserious
Master Superior
Posts: 1418
Joined: Sun May 11, 2008 11:53 am
Location: Wandering around aimlessly in Lynchgate Woods
Contact:

Re: RTC in a Text Editor

Post by Seriously Unserious »

That's great, looks like you're starting to get the hang of this.

I just took a quick look at an RTC formatted text file and from what I can tell, the "/*" opens a comment and the "*/" closes a comment, each main section seems to each start with a line that looks something like this:

Code: Select all

[some text here]
and end with a blank line, followed by a few comment lines, except for the "Layout" section which also has a blank line between each individual level.

In the layout section, each level starts with the line:

Code: Select all

; Level X
where X is the number of the level, and ends with a blank line after the binary map. For the binary map, each line represents a row on the map grid and each 0 a wall tile and each 1 a floor tile. Also, each level ends on the map to it will also always end on either a "0" or a "1" followed by 2 "enter" (aka "end of line" eol for short) characters.

You may need to look up the ascii code for the eol character and if Notepad++ can accept ascii codes but since it's meant at a programmer's tool I'd guess that it does.

I hope that info helps you to identify what you need to use to get each section and each level to fold in and out properly. Once you do get it working, please post the exact steps you took and definitions you used to get it working as I'd love to know that myself, as that would make hand coding more attractive for me and I'm working on a task in my own project that would be much faster and easier if I could easily use Notepad++ to work on it.
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Steps taken:

1. Load dungeon text file into notepad++
2. Go to Language>Define Your Language...
3. Select "Create New..." and name a new language for use with dungeon files
4. Go to 'Folder & Default' tab
5. In 'Folding in comment style:' enter the following:

In the 'Open:' box:
*/

In 'Close:' :
/*

6. In 'Folding in code 1 style:' enter the following:

In the 'Open:' box:
Level

In 'Close:' :
;

7. Save language and ensure it is active in the Language main menu drop down when viewing your dungeon file.

Step 5 allows you to compact each main section down: ie, the 'New - Bitmaps' section, for example. Step 6 ensures you can compact all the level configurations down.


Pressing Alt-0 folds the entire document. Saves on mouse wheel scrolling when navigating a large document!!!
User avatar
Seriously Unserious
Master Superior
Posts: 1418
Joined: Sun May 11, 2008 11:53 am
Location: Wandering around aimlessly in Lynchgate Woods
Contact:

Re: RTC in a Text Editor

Post by Seriously Unserious »

Awesome, thanks eb. I entered that into N++ and got it working nicely. That definitely cuts down on the wall of text and makes it more manageable.
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Just a quick update - have been putting some serious dungeon creatng time in recently, Notepad++ is a really amazing bit of software to use alongside RTC. You can jump around the document really easily, and you can also edit added graphics, wallsets, and objects really easily, for the most part miles better than doing it in RTC Editor. Recomended.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: RTC in a Text Editor

Post by Gambit37 »

Working in code is generally much more efficient than using a clunky GUI. You might now consider switching to DSB ;-)
User avatar
ebeneezergude
Expert
Posts: 345
Joined: Mon Jan 21, 2013 10:58 pm
Location: I see walls stretching off into the darkness...

Re: RTC in a Text Editor

Post by ebeneezergude »

Hey Gambit, yes I thoroughly investigated the great DSB. Awesome piece of software. Ultimately it comes down to attempting a full graphics replacement project, which coupled with my slightly more visual approach, is better done in rtc. I love dsb, I think it's awesome. But with multiple wallsets and large levels I found ddb harder to use. But that's just me and the way I work. I had set dsb up in ways rtc couldn't handle. But not for this more complex project. George and Sophia - get collaborating! ;-). (Edit: I know GG is inactive, was just being facetious)
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: RTC in a Text Editor

Post by Gambit37 »

I know what you mean, I prefer to work in a visual way too. But I was also attempting a full graphics replacement for DSB and actually found it much easier doing it in code than trying to work with RTCs strange tabbed menu system: I could never find anything in those tabs and once you start adding lots of images they soon become very unmanageable. (Categorizing images by "number of scalings" was one of the stranger decisions George made in my opinion: it makes no sense as a way of finding anything!) At least with DSB you can modularise all the new graphics however you like and once you have a system for that it becomes so much easier than clicking through hundreds of menus.

As for testing, when you factor in that DSB starts almost instantly and RTC has a crazy long loading delay, it becomes much, much more efficient testing your graphics in DSB than RTC. DSB also has a more intelligent graphics placement system than RTC and most stuff just works as you'd expect. If a graphic isn't quite where you want, you have a more extensive coordinate tweaking system in DSB too.
But with multiple wallsets and large levels I found DSB harder to use
Have you looked at DSBs wall painting mode in the ESB editor? Couple this with DSBs better handling of large maps, I think you'll be pleasantly surprised at how easy it is to manage this in DSB compared to RTC.

I know we've had these discussions before and I know I won't convince anyone to switch over if they don't want to. However I can confidently say that having used RTC and DSB extensively, and having *really* loved editing in RTC initially, I have found that I am far more efficient and productive in DSB (once you get over the initial learning curve). But I'm being naughty here by taking the discussion off topic. Each to their own :)
Post Reply