The ERF is a project I'm doing for the Raspberry Pi summer programming contest.

I'll be using this topic for progress reports and stuff, as well as a reference document. The official rules don't say anything about source code, so I might put that here too. (you know, a link to a repo or something)

So...here's some of the things I plan to implement.

-A unified class system for managing battle stats of players and monsters. This way a player could use any character with defined stats as either a player or a monster.

-An event system where the events are customized python code segments, probably going to be functions in a designated file or section of a file in the framework. This would have everything from animations to spell effects inside, and functions can reference each other. Very modular.

-A data management structure for managing inventories (multiple or singular) of either unlimited or arbitrarily limited capacity.

-A Sound system that allows smooth blending between different background music tracks while playing an arbitrary number of effect files.

-And others.

I don't think I'll include any preferred graphical interface as part of the standard framework, since it's intended to work for anything from ASCII to SDL to OpenGL, or any other display method. Plus, it would take a LOT of time to set up an OpenGL method, especially since I don't know OpenGL, and frankly don't know SDL all that well.
So, now that it's been a few days, a progress report.

I have a map storage system working. It keeps the map in a pseudo-binary file format. There can be up to 256 different tiles. Length and width are determined by the first 8 bytes, which are two ASCII integers interpreted by the interpreter. This makes reading maps in a hex editor really easy.

I've set up a basic character class as part of the map module. They have the capability of having a set speech from a file, and to automatically create a set of monsters to fight. It's intended that monsters and NPCs share the same class. The map system itself needs to be rewritten, to work with the new map tiling system (I was going to make on using lists, but the new way is far more storage-friendly)

There's also a module called battle, which allows for invoking the battle engine, and contains the classes for participants in said battle. The player's fighters and the enemies are stored in the same format, for flexibility. The engine itself isn't written yet, but the class for storing battle participants is.

One of my end goals is for the end framework to require absolutely no imports of other modules, including os and sys. So far, that's working out just fine.
I guess this is implemented in Python, based on that last sentence of your most recent post. Why would you want to avoid needing to import sys and os? That seems like an unnecessary restriction on yourself to me. Other than that, this sounds like a nifty plan, and I hope you see it through. When you say "set speech", I presume we're talking about a text string rather than an audio file? Although I noticed that (!) you mentioned a Sound system, which is cool.
I'm actually not avoiding sys, I just haven't needed it yet. As for OS, the commands vary from windows to linux enough to make cross-compatibility an issue.

Currently, I'm trying to figure out a decent way to get keyboard input without using ncurses (unix-only, or mingw dependent) SDL (Graphically dependent) or OpenGL (Do I need to say anything?)

I'm planning, after it's done, to release it in an "option" style, such that it would have an SDL version, a curses version, etc. but I want one that would run on literally anything that can run the full python interpreter. The sound system would be one of these.

Oh and yes, with the speech bit I was referring to text.

By the way, I got the mapper's partial display routine to work. I'm planning on making the map display work as follows:

*Map tiles are stored in a list of strings.
*Said list is turned into a single string with newlines every frame. This is the part where only a certain X and Y range is taken, so from here on the map is only the local view.
*Said string has any objects on the map (people, monsters, items, etc.) applied. I'm debating about having speech being displayed on the map, so it would go here too.
*Said string is messed with however the programmer wants to mess with it. Razz
*String is displayed.
By the way, I got really excited when I found PyPy, a JIT-style rewrite of the python interpreter. An average of 5.7x faster is pretty awesome!

Anyways, up next is the inventory system. I think I'll have the items totally separate from everything else, and contained in a class. That way, it's easy to make some small changes for multiple inventories, ie for multiple party members, or for shops, etc. I think I'll have gold be part of that too, so expect Elder Scrolls style shops by default.
willrandship wrote:
I'm actually not avoiding sys, I just haven't needed it yet. As for OS, the commands vary from windows to linux enough to make cross-compatibility an issue.
That's the whole point of the OS module, to abstract away OS-dependent features. Smile I guess if you need to call out to external programs, though, it gets much more complicated.
Quote:
By the way, I got really excited when I found PyPy, a JIT-style rewrite of the python interpreter. An average of 5.7x faster is pretty awesome!
Great! Although I had thought that Python already did bytecode compilation.
Quote:
By the way, I got really excited when I found PyPy, a JIT-style rewrite of the python interpreter. An average of 5.7x faster is pretty awesome!
Great! Although I had thought that Python already did bytecode compilation.[/quote]CPython compiles to bytecode, which is then interpreted. PyPy is a true JIT.

The implementation of PyPy is rather interesting, since the interpreter itself is written in a statically-typed subset of Python that they've dubbed rPython. rPython can be translated to C, Java bytecode or .NET CIL. With some bonus annotations in the interpreter source code, it generates a JIT for the interpreted Python code automatically.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement