OK.. My little summer project has gotten bigger than I thought small history: ITS A remake of a well known BBS game LORD - there are many ported to the web via java and telnet, but I wanted a true Browser based game of it - and since I could not find one, I made one - note: I am aware of the LOTGD, its not quite the same) I've been in contact with the original author of the game, and since he sold it, he cannot give me any details of the game but he does like what I have done so far. - I am currently waiting for the new owners to write back, and if they pitch a fit, i'll make some changes - after all, it is more of a personal project than a public on - ergo i WANT TO FINISH IT LOL (I would say it is over 85% done - it is winnable as well - yes end game is completed)
So it has gotten, well, actually its kinda HUGE!! I a still have parts to add. Writing in PASCAL is differnt than writing in php/html (I know 7 languages pretty well, so conversion is not an issue) Without getting into details - not the purpose of my post The issue I am having is organization. I have about 80 some files 3/4 of which are templates Basic psuedo code is as follows
everything is run from the index.php. depending on users location, session vars and REQUEST vars, it will branch to various functions. some examples:
index.php as is will be treated as a user logging on
index.php?q=inn branches to a displayInn function (with more options in there) and displays it accordingly.
casting a skill/spell? no prob index.php?q=fght&s=sid (fighting, using skill reference sid=skill id)
and so forth.
my question, is I think my organization is all wrong, because now its starting to get cluttered. I comment HEAVY!! so what things are doing is not the issue. is "squeezing things in that is becoming an issue.
So need a little help on the organization part (programming I got) I know there is a HUUUUGGGEEE debate on OOP vs FUNCTION (procedural) programing, so to avoid THAT debate, I am partial to the FUNCTION method for this prticular project. So no debates please. Unless you can prove without a doubt - that is the way to go.
Some Ideas I was thinking is group each location individually and then options that go with those (example fighting location gives options RUN, FIGHT, SKILLS etc..., then those will branch off to different functions to yeild outcomes.) town, same thing, each town has sub menus branching etc...
Love to hear some different idea. On the outside, the game plays quite nicely - but its the internal programming that is very ugly.
want to check it out - http://lotrd.sytes.net (its alpha and buggy, but there are no wipes - even if i change the name and format due to legalities) but look at it from a programers point of view. its very "kludgy"
I been programming since mid 80's, so the following can be shown to me in just about any language, and I'll be able to convert it.
Here is my dilema:
I am very nostalgic and many games that are written in "ascii" are still around today, and still very popular (L.O.R.D. for example, and the recent 2006 hit Dwarf fortress). So that should scale this to easy. I thought.
I spend many weeks looking up ways to make (what i thought) a simple, flat 2D terrain generator that I can use in a ascii game. And found all kinds of complex and really obscene algorithms and formulas that are not unlike driving a viper to to pick up your paper at the end of the drive.
So I gathered as much old-school skill I had and tried tons of variations of randomness to get a "grouping" style terrain, instead of the usual "paint-splatter" style. I tried the usual x,y method, perlin types but they were not laying out like I wanted (I even tried sin() math and that was pretty close, but too predictable, obviously) - they were more designed for 3D and in depth style graphic games.
The 2D I want is a TOP down (think of "droidcraft", "Don't starve" etc.. - those are the best i can think of off the top of my head). I only need like 6-10 tile types, and I can probably work out underground caves.
Any one else have an idea how to generate a fairly "logical" way of doing this, such as trees in a group, then maybe spread to some tall grass to plains, then maybe hills that turn into mountains etc...