Computer Science Canada

OOT RPG Framework

Author:  Aange10 [ Thu Mar 22, 2012 12:29 am ]
Post subject:  OOT RPG Framework

Well, a friend and I tackled on the project of making an RPG. We worked on it for about two weeks but we called it off.


However I've had this for a few months now, and as it seems I won't be getting back to it, I might aswell put it up here for you guys to see.



This was my very first time ever programming in OOT (note this was a few months ago) and the first time ever programming in an object orientated paradigm period. I'm honestly very happy with the RPG. The only thing that I severely frown upon is the way the spells system for characters was handled. However before stopping with the project, I was about halfway done with a "Spells.tu" to handle all of my animations, spell affects, etc. so that it wouldn't be jumbled into the character class the way it was (very edge case, and very confusing, imho)


Other than the spells, I'm happy with how the project turned out. Especially that I completed the Enemy.tu for (what I think) would be the rest of the project.

However I do have a few questions/comments:

- I was very new to keeping and holding a 'state' variable. At the beginning it was edited constantly depending on what was happening. Later I found that that was bad, and decided to make one procedure to handle updating the state. Is there a better way I could have gone about this?

- Other than the spells, is there any criticism you could give? Either on the respects that in a bigger game X would fail, or anything of similar clause

- I'd also like to note that I fixed the glitch where jumping past ladders attached you to them, however the version of that is lost somewhere in cyber space Wink

- I'd also like to state that the second level was there only to test the maps, etc. The bug with attacking there is because there are no monster entities to register UpdateState for the character, and the map is extremely big because at first we were going to make it scroll through some maps, but decided against it.




Thanks for your time, any feedback is appreciated! A lot of hard work went into this project, and all graphics are thanks to Beastinonyou

(Also, I knew my Collision module would come in handy!)

Author:  Tony [ Thu Mar 22, 2012 12:46 am ]
Post subject:  Re: OOT RPG Framework

Aange10 @ Thu Mar 22, 2012 12:29 am wrote:
- I was very new to keeping and holding a 'state' variable. At the beginning it was edited constantly depending on what was happening. Later I found that that was bad, and decided to make one procedure to handle updating the state. Is there a better way I could have gone about this?

deterministic finite state machines are my personal favourite. http://en.wikipedia.org/wiki/Deterministic_finite_automaton

Author:  Aange10 [ Thu Mar 22, 2012 12:52 am ]
Post subject:  RE:OOT RPG Framework

Tony wrote:

deterministic finite state machines are my personal favourite. http://en.wikipedia.org/wiki/Deterministic_finite_automaton


I see. Other than a giant definition that I don't understand, what is this?

What I grasped is that it take in an input, and determines if it should be used or not?

Author:  Tony [ Thu Mar 22, 2012 1:35 am ]
Post subject:  RE:OOT RPG Framework

DFAs are functionally equivalent to regular expressions, so yeah... that's a common use.

In Computer Science papers DFAs typically operate on binary strings (0s and 1s). Typical application of (regular expressions) is on regular strings (match a pattern in a document). But "input" can be anything, such as "player has cast a spell". At this point you are starting to move towards event driven programming, and a DFA is a structure that keeps state and determines which events are valid to happen next.

Author:  Aange10 [ Thu Mar 22, 2012 1:31 pm ]
Post subject:  RE:OOT RPG Framework

Oh. Having that determine what happens next kind of seems useless. At least, it seems like I'd have to define a scenario for every 'input'

I kind of avoided telling my program what to do, rather, I had my program ask each other what comes next.

Like my monsters would ask my character if they are in range, or if the character is attacking, etc.

My character would ask the ladder if he was on it.

I never really did any kind of 'scenarios', I allowed input via the keyboard, and everything else happened by itself

Author:  Aange10 [ Thu Mar 22, 2012 2:15 pm ]
Post subject:  RE:OOT RPG Framework

Oh and I found the version with the bug fixes, but I'm not going to upload it because it's big. I could always just upload the 20 kb Turing files, but then again that'd be more work than people generally like to do (downloading and replace more files)

Author:  Tony [ Thu Mar 22, 2012 3:17 pm ]
Post subject:  Re: RE:OOT RPG Framework

Aange10 @ Thu Mar 22, 2012 1:31 pm wrote:
At least, it seems like I'd have to define a scenario for every 'input'

DFAs can describe infinite languages (e.g.: a binary string of any length), so that's obviously not the case. What it does do is it gives you an ability to collect your game logic into a data-structure. It's very useful, when the alternative is pieces of code throughout the project.

Author:  Aange10 [ Thu Mar 22, 2012 4:32 pm ]
Post subject:  RE:OOT RPG Framework

Quote:

What it does do is it gives you an ability to collect your game logic into a data-structure.


What kind of structure would this be? The only data structure I've worked with (at least that was coined as such) is my "index" for a web crawler.

The data structure looked like this:

code:

Index = [ [Bucket, [Keyword, [urls, hits ] ] ],
               [Bucket, [keyword, [urls, hits ] ] ],
               .
               .
               .
               ]


Which is really just a list. With that being my only knowledge of a data structure, how would I interpret input and logically fabricate a data structure out of it?

Author:  Tony [ Thu Mar 22, 2012 5:21 pm ]
Post subject:  RE:OOT RPG Framework

at this point I would suggest picking up on the basic data-structures -- arrays, lists, trees, maps, etc. The knowledge is fundamental to Computer Science, and you need this foundation to take on more complicated stuff later on.

Author:  Aange10 [ Fri Mar 23, 2012 11:46 pm ]
Post subject:  RE:OOT RPG Framework

No other comments?

Author:  Aange10 [ Sat Mar 24, 2012 11:44 pm ]
Post subject:  RE:OOT RPG Framework

Hmm, well this is the last time I'll bump this thread, but it's sad to see 120+ hours go into this with no feedback =/

Author:  Dreadnought [ Sun Mar 25, 2012 5:18 pm ]
Post subject:  Re: OOT RPG Framework

Aange10 wrote:
Hmm, well this is the last time I'll bump this thread, but it's sad to see 120+ hours go into this with no feedback =/

I don't know what to say...
It's an unfinished game, therefore I wouldn't compare it to any finished game. Maybe some info, like how to play, would have been nice. (I had to try every key on my keyboard to see what worked).

I guess the animation of the dogs dying could be faster, but I would expect things like this from an unfinished game.
Sorry the feedback is so small, hopefully you at least learned stuff while writing the code.

Author:  Tony [ Mon Mar 26, 2012 1:40 am ]
Post subject:  Re: RE:OOT RPG Framework

Aange10 @ Sat Mar 24, 2012 11:44 pm wrote:
but it's sad to see 120+ hours go into this with no feedback =/

Try 4 years. http://www.youtube.com/watch?v=GhaT78i1x2M Wink (also, Indie Game The Movie is an amazing movie)

Author:  Aange10 [ Thu Apr 05, 2012 7:18 pm ]
Post subject:  Re: OOT RPG Framework

Dreadnought @ 25/3/2012, 4:18 pm wrote:
Aange10 wrote:
Hmm, well this is the last time I'll bump this thread, but it's sad to see 120+ hours go into this with no feedback =/

I don't know what to say...
It's an unfinished game, therefore I wouldn't compare it to any finished game. Maybe some info, like how to play, would have been nice. (I had to try every key on my keyboard to see what worked).

I guess the animation of the dogs dying could be faster, but I would expect things like this from an unfinished game.
Sorry the feedback is so small, hopefully you at least learned stuff while writing the code.



Yeah I probably should have given instructions. But thanks, I mostly was looking to see if the code had any errors, or if I was "doing it wrong".

I really didn't want critique on the actual game.


A and D move left and right, W goes up the ladders, S goes down the ladders, ALT jumps and CTRL attacks

Author:  Gadd [ Thu Apr 05, 2012 8:38 pm ]
Post subject:  RE:OOT RPG Framework

It was nice, one thing I found wrong is when you hit your attack key like 5 times fast it will keep going. Also sound would be cool along with a challenge such as having to hit monsters 2-3 times rather than 1.

Author:  Aange10 [ Fri Apr 06, 2012 12:11 pm ]
Post subject:  RE:OOT RPG Framework

Quote:
such as having to hit monsters 2-3 times rather than 1.


You can change your damage under Scr -> Saves -> Savename.txt

Author:  Raknarg [ Fri Apr 06, 2012 12:40 pm ]
Post subject:  RE:OOT RPG Framework

The reason it keeps going is probably just because he has key echoing on. You can use Input.Flush or set the screen to noecho

Author:  Aange10 [ Fri Apr 06, 2012 2:25 pm ]
Post subject:  Re: RE:OOT RPG Framework

Raknarg @ 6/4/2012, 11:40 am wrote:
The reason it keeps going is probably just because he has key echoing on. You can use Input.Flush or set the screen to noecho



Good call, but the input is flushed. On line 425 in the Characters class


Turing:

 fcn detectMovement (map : pointer to Map) : boolean
        var chars : array char of boolean
        var isOnLadder : boolean := Map (map).isOnLadder (xCord, yCord)
        Input.Flush
        Input.KeyDown (chars)

Author:  Gadd [ Fri Apr 06, 2012 3:52 pm ]
Post subject:  RE:OOT RPG Framework

Yea but, a total noob who picks up your game wont do that, or even know what to do. My suggestions were for probability towards those who cant code and just wanna download your game a play simply without trouble.

Author:  Aange10 [ Fri Apr 06, 2012 4:05 pm ]
Post subject:  Re: RE:OOT RPG Framework

Gadd @ 6/4/2012, 2:52 pm wrote:
Yea but, a total noob who picks up your game wont do that, or even know what to do. My suggestions were for probability towards those who cant code and just wanna download your game a play simply without trouble.


Indeed that is the intention; what are you talking about?

Author:  Gadd [ Fri Apr 06, 2012 8:45 pm ]
Post subject:  RE:OOT RPG Framework

I mean if I said here little brother play this, he can't adjust to his liking as he can't code not to mention in real time you can't access the code. I was giving you feed back towards ways you could have fixed it in that manner.

Author:  Aange10 [ Sat Apr 07, 2012 10:18 am ]
Post subject:  RE:OOT RPG Framework

No I understand your feedback. I mean, what would he have to code? There is no coding required.

Author:  Aange10 [ Sat Apr 07, 2012 7:47 pm ]
Post subject:  RE:OOT RPG Framework

If you're talking about having to edit the file to change the damage, that's not meant to be edited. At least, right now it is to test things, but if I were to finish the game I would encrypt it, and the game itself would update the damage and etc. (Via new weapons, abilities, stats, etc.)


: