Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: Darkknight512 on March 10, 2010, 09:20:55 PM

Title: Menu based text RPG
Post by: Darkknight512 on March 10, 2010, 09:20:55 PM
I'm planning on writting menu driven text RPG for rockbox. I know C++ but I don't know C yet but will be learning starting this March break.

I'm wondering if there is any interest in something like this and what are some ideas and game mechanics you would like in the game.

Also if you know of any good C tutorials PM me.
Title: Re: Menu based text RPG
Post by: AlexP on March 11, 2010, 03:13:04 AM
Not a feature idea, but for what you are doing this thread might be of interest: http://forums.rockbox.org/index.php?topic=24090.0

Edit: Er, someone just pointed out to me that I've just directed you to your own thread :)  Sorry about that :)
Title: Re: Menu based text RPG
Post by: Darkknight512 on March 11, 2010, 04:29:51 PM
That's alright haha.
Title: Re: Menu based text RPG
Post by: Strife89 on March 17, 2010, 12:20:22 PM
I'm planning on writting menu driven text RPG for rockbox. I know C++ but I don't know C yet but will be learning starting this March break.

I'm wondering if there is any interest in something like this and what are some ideas and game mechanics you would like in the game.

Also if you know of any good C tutorials PM me.

I have a few ideas, but what has me the most intrigued is: Do you want a "generic" story, or do you want something like a late Final Fantasy game, story-wise?

Either way, I offer my writing skills. :-)
Title: Re: Menu based text RPG
Post by: Darkknight512 on March 17, 2010, 12:29:05 PM
Please don't bump posts.

Also, if you want to do this, just do it. Maybe if you actually had some work to show for it, people could recommend improvements / tweaks. At the moment though, you've asked and incredibly open-ended question that is mostly pointless to answer at this time.
I don't see anything forbidding bumping but if you say so.

I will get on that.

Now this was my first C++ project, it is quite incomplete at the moment, it is basically a text based combat system for an RPG (which was halted). I was planning to make another version that uses ncurses/pdcurses so I can build an actual Text-User Interface with scrolling menus, sub windows and the like.

http://www.mediafire.com/?nmnnamenzfz

However I think writing a pure text adventure would not be a bad idea, something like Zork with no battle system and only a basic item system, and using 4 directional buttons + one that enters the standard rockbox menu.
Title: Re: Menu based text RPG
Post by: torne on March 17, 2010, 01:19:00 PM
I was debating implementing the ncurses API in pluginlib at one point. Decided it wasn't worth the effort at the time (and ncurses is not that great an interface in my opinion). Do you think this'd be valuable?
Title: Re: Menu based text RPG
Post by: Darkknight512 on March 17, 2010, 01:55:07 PM
I don't think I would be the best person to ask, I have not written a lot of code, and I have never written any Rockbox code so I do not know the limitations of the pluginlib.

I think from what I have seen in the current plugins that they lack the ability to cut the screen up into sub windows and draw in each one independently. Ncurses would also allow us to make selection menus within the game. I haven't seen this in other plugins but Ncurses may give the ability to color text individually.

So depending on how hard it is, it may be worth the effort.

My question is, is there many things written in Ncurses already that will allow us to port a few things over after Ncurses is implemented into rockbox?
Title: Re: Menu based text RPG
Post by: torne on March 17, 2010, 02:10:04 PM
We have viewports, which let you divide the screen up and draw in them independently. You can bring up menus from plugins. You can colour text. All these things already exist, but the Rockbox API is for the most part oriented around pixels; it doesn't simulate a text terminal.

There's a lot of software that uses ncurses for display, but how much of it would be useful to port, and how much will actually work with the limited screen size, is a different question.
Title: Re: Menu based text RPG
Post by: Yotto on March 18, 2010, 11:47:42 AM
I think this is a wonderful idea. I think though (and excuse me if this is already the plan) that it should be implemented in 2 parts: engine and content. Also, the ability to save at any point is a must in a DAP, where you'll be playing this game to kill time, and must stop instantly when the real world demands your attention.

I would love to write one of these, or do a section. I can't do the code so much but have a few ideas for stories.
Title: Re: Menu based text RPG
Post by: Darkknight512 on March 18, 2010, 01:01:16 PM
My original plan was to have engine and content separate, but with my limited programming skills, I am going to need some help with that. Right now I am just reading through the wiki for all the articles that apply to me, if you have anything I should read please post it.

How would I make the game engine read scripts? And is there a format that is proven? I did look a bit into TinyXML when I was making my combat system last year.

It may take a while before I get some code done, since this is my first real project I anticipate this to be a bit of a struggle. What I posted above and the code I wrote for my highschool robotics team is pretty much all the programming I have done.
Title: Re: Menu based text RPG
Post by: torne on March 18, 2010, 04:52:15 PM
If you are seriously considering designing a generic RPG engine which can be used by other people to make different games, then this is quite an epic task, and I would strongly suggest you either *don't* start by doing it on Rockbox, or you find an existing engine which is suitable and port that (many such engines *exist*, but how suitable they are for the limited screen size and input options will vary).

I don't want to discourage you from learning, but actually coming up with that kind of thing is not something I'd suggest anyone undertakes as a first programming project. If you are asking questions like how to make the game engine read scripts, then you are probably not qualified to be designing it, to be brutally honest :)

In terms of "time until something fun is created", I'd probably suggest that you be less ambitious to start with: produce a game at all, and then think about how to separate the engine for reuse later.
Title: Re: Menu based text RPG
Post by: Darkknight512 on March 18, 2010, 06:00:33 PM
Maybe I should take on the task of just building the combat system. Just have partialy randomly generated monsters and maybe character creation at the beggining. Every level you would be able to go to the item shop/weapon shop and add stat points.

I guess it would be almost 100% linear, but I guess that should be fine.

I remember using .ini files to save data in C++ before, what would be the alternative in RB?

A mini story line would still be possible.

I think that would be an easier task yet would still be a fun game, do you think that is feasible?
Title: Re: Menu based text RPG
Post by: saratoga on March 18, 2010, 06:28:26 PM
I remember using .ini files to save data in C++ before, what would be the alternative in RB?

INI are just text files.  You can read text in rockbox using fopen.
Title: Re: Menu based text RPG
Post by: Darkknight512 on March 18, 2010, 06:34:12 PM
Ok, so pretty much everything you can do in standard C should work in Rockbox but stuff like maloc?
Title: Re: Menu based text RPG
Post by: torne on March 19, 2010, 07:35:29 AM
*Most* standard C things work, but we lack a random assortment of functions from the C library simply because nobody has needed them and thus they haven't been implemented. You can have a working malloc() in a plugin if you want, several plugins already have this - it's only the Rockbox core which (currently) doesn't do dynamic allocation. It's generally best to avoid it if you don't really need it, though.

Your idea sounds good; it doesn't have to be super awesome the first time around, if you produce *something* that works and is playable, even if it has limited scope for story/etc, then people are much more likely to contribute ideas, content or code to help make a better version.
Title: Re: Menu based text RPG
Post by: Darkknight512 on March 19, 2010, 10:58:57 AM
Would it be a good idea to first write the game in Win32-console or just go straight to Rockbox?

How exacly am I supposed to make the game work on all LCD sizes? Is it possible to just scale everything, just try to keep the amount of text on the screen as little as possible?
Title: Re: Menu based text RPG
Post by: torne on March 19, 2010, 12:05:23 PM
The console on a regular OS has very little in common with Rockbox - while we have the ability to print text, we really are mostly a graphical system, and this is why I had to invent a terminal-like interface for frotz to use. The ability to print text in a grid is very limited, mostly you need to think of everything in terms of pixel coordinates. Having said that, the fact that the output system might be different doesn't mean it wouldn't be easier to develop the meat of the game on a different platform first (one with a debugger, mostly) :) It's up to you really; how soon do you want to see your code running on Rockbox?

Making the game work on all LCD sizes depends greatly on what kind of display you are going to have. The image in my head may not match up with what you are thinking of, so I produced this mockup of what I was imagining using all of my Amazing MSPaint Skills:
(http://whitefang.wolfpuppy.org.uk/temp/lol_rpg.png)
If that's the kind of thing you were imagining then that's easy to scale to different screen sizes, within limits: the main text window can just wrap at whatever width and will scroll more often if the screen is smaller, and the commands and so on could pop up over the top while it was prompting you. It should fit on a pretty tiny display if people don't mind a lot of [MORE] prompts ;)
Title: Re: Menu based text RPG
Post by: Strife89 on March 19, 2010, 03:42:56 PM
I personally like Torne's layout, but I figured I'd throw in my own program for the sake of (possibly) helpful ideas. :)

It's written in TI-BASIC, so I went ahead and set up a copy of Virtual TI and installed the game on a virtual TI 83. Here's a link:

http://dl.dropbox.com/u/1905158/virtualti-ready-to-roll.zip
(Extract the .zip and run vti.exe, then press Enter on the virtual keyboard to run the program. You can also press [PRGM], then use the arrow keys to select Edit and look at the code.)

It's not a pretty program by any means, but I figured it might give a few ideas about the battle structure. I use a LOT of GoTos, though, so you'll want to look into different coding methods, for sure.

----

Also, I have the beginning of a story idea done, if you want to look at it. It was written with a graphical overworld in mind, but it can easily be rewritten to text-only.

http://dl.dropbox.com/u/1905158/The%20Rockbox.txt

Let me know if you think it's crap, if it's decent, or if you'd rather try a different idea. :)
Title: Re: Menu based text RPG
Post by: Darkknight512 on March 19, 2010, 04:03:27 PM
A few posts back I posted my old game written in C++, by no means is it even close to complete but this was the interface I started with. What I wanted to do was to change the menu so that it is controlled by arrow keys and select button (In this case enter)

(http://img225.imageshack.us/img225/8398/gamei.png)

Link to Win32 EXE -> http://www.mediafire.com/?nmnnamenzfz

With some modifications, and removal of some of the useless data I think that could fit onto a display about the size or the Nano's. Maybe on the players that are even smaller, use prompts for "What happend"