Lost Magic
Author |
Message |
TheOneTrueGod
|
Posted: Thu May 18, 2006 6:50 pm Post subject: Lost Magic |
|
|
Hey, this is the game i've been working on for the past 1.5 weeks. Its directly based off the game Lost Magic for the Nintendo DS. There is an in-game tutorial that teaches almost everything you need to know, just READ THE ENTIRE THING.
The only things it doesn't cover yet are as follows:
w/s select the level you want to enter, and "enter" will start that level. You can replay old levels for exp and to capture monsters.
In order to capture monsters, you need to reduce them to a very low HP, and then cast the dark spell on them. Once they have been captured, win the level and you can use them next battle. I have capped the number of monsters that you can use in one battle to three currently, but this number may change, and your units will still be stored in memory.
Saving is as simple as pressing 'o' on the world map, but I havn't extensively tested this yet, so I give no guarantees as to how well it will work.
Finally, you can combine two spells together to create a new effect. Just, for example, hold space bar, click on fire, click on fire again, then right click the cast location (while still holding space bar).
Keep in mind that Fire + Ice is different than Ice + Fire.
I have done all double combinations except for Dark + Anything. (Anything + Dark works though, 'cept for Dark + Dark)
Enjoy!
Future plans:
-Story
-Making it so you can lose the battle
-Being able to choose which of your monsters you can bring into battle.
-Triple spells
-Balancing spells
Description: |
|
Download |
Filename: |
Lost Magic.rar |
Filesize: |
38.98 KB |
Downloaded: |
303 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
rownale
|
Posted: Thu May 18, 2006 8:01 pm Post subject: (No subject) |
|
|
Seems a bit glitchly like the first time i ran it my character appeared fine but it later crashed. 2nd time my character was invisible. 3rd time it didn't work.
otherwise it looks like a good concept and id say pretty good for only 1.5 weeks of work as compared to my rpg that im making now(almost a month and still not nearly as good lol) (not posted)
needs some work still and i do hope you finish it
good job overall
|
|
|
|
|
|
TheOneTrueGod
|
Posted: Thu May 18, 2006 9:02 pm Post subject: (No subject) |
|
|
Er, It shouldn't have done that... lol, did you change any directories or anything? You have to extract all the files into one common folder, or else it generally won't recognize file paths. I've been testing the gameplay part of it every 20 minutes or so that i've been programming it, and i've never ran into that problem...
|
|
|
|
|
|
HellblazerX
|
Posted: Fri May 19, 2006 10:31 am Post subject: (No subject) |
|
|
This is a very nice program. Very smooth animations, and I like the font for the main screen. One suggestion is to have some explosions with the spells, cuz explosions are fun . Bits for you.
|
|
|
|
|
|
Cervantes
|
Posted: Sun May 21, 2006 12:33 pm Post subject: (No subject) |
|
|
Hmm... I'm thinking the OOP could be tighter. You're still using a string sequence to identify things, particularly spells. What if each spell had it's own class, inheriting from a base Spell class? You wouldn't have such a huge CastSpell procedure. And the CastSpell procedure would be part of the Unit class, aye? A similar thing goes for Projectiles, but I think spells and projectiles are overlapping here.
Functions like Angle and Distance could be put into a Math module.
You've still got a lot of procedures and functions sitting in the toplevel. Can't they be further organized?
Good stuff, TOTG. + 50bits.
|
|
|
|
|
|
TheOneTrueGod
|
Posted: Sun May 21, 2006 5:14 pm Post subject: (No subject) |
|
|
Thanks for the info (First feedback i've gotten on programming OOP ) But how would I make it so that every spell had its own class? My plans are to have 258 different spells, each one unique (ish). What other good ways to manage them all, other than strings to check which spell is being cast, are there?
Other than that, i'll see how well I can tighten it up. Thanks
Edit (God I love being able to do this again ): Is there any way to make my Ice spire code managed within the class itself?
(Whenever the duration reaches 10, a new instance of itself is created in front of it, while the first one still exists.)
If you want to see what I mean, cast the spell "Rock+Ice"
|
|
|
|
|
|
Cervantes
|
Posted: Sun May 21, 2006 5:27 pm Post subject: (No subject) |
|
|
TheOneTrueGod wrote: TBut how would I make it so that every spell had its own class?
Inheritence. Figure out what is common to all spells and extract that to a common Spell class. I'm going to base what I say next on spells in... Diablo.
All spells in diablo have a mana cost, a minimum required level, a level (# of skill points you've put into that spell), a modified level (# of skill points you've put into that spell + effects of items), a class (Fire, Ice, Lightning, Bone...), and probably some more stuff in common. All that should be part of the base Spell class. Then there are a lot of spells that are very similar: projectile spells that shoot a firebolt or icebolt or teeth or a bone spear, etc, dealing direct damage; Terrain modifying spells such as bone wall, bone prison, and wall of fire (I'm amazed I can remember these); buffs, such as enchant weapon and poison blade. These further subdivisions could be made to further reduce the amount of repeated code.
I highly suggest you plan out the class hierarchy before you begin coding the classes. Inheritence doesn't save you any coding if you're constantly changing the class structure because you think of new features that don't fit into the current structure.
|
|
|
|
|
|
TheOneTrueGod
|
Posted: Sun May 21, 2006 5:33 pm Post subject: (No subject) |
|
|
Hmm, but wouldn't string separation still be handy, so that two spells that do the same thing but look different not require separate classes? (Also, read edit to above post)
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Cervantes
|
Posted: Sun May 21, 2006 5:49 pm Post subject: (No subject) |
|
|
What's the matter with having two separate classes for those two spells that act almost identically? The only problem with having two classes for this is if those two classes share code via copy and paste. Rather, they should share code via a common ancestor class that they inherit from.
Depending on the spells that you have, your hierarchy of classes could be pretty convoluted. You could have your base Spell class, then a SpellProjectile class, then from there you could have a Firebolt class and a another class for a type of spell that deviates a bit from a projectile, which would then have a bunch of spell classes inheriting from that.
hopefully_monospaced_font: |
A
/ \
/ \
B C
/ \ / \
D E F G
/ \
H I
|
But so long as the final spell classes (such as the Firebolt class and the Icebolt class) are in some way descendants of the base Spell class, you're good.
TheOneTrueGod wrote:
Edit (God I love being able to do this again ): Is there any way to make my Ice spire code managed within the class itself?
(Whenever the duration reaches 10, a new instance of itself is created in front of it, while the first one still exists.)
If you want to see what I mean, cast the spell "Rock+Ice"
Sure, this is possible. It would be sort of like a Linked List structure. Give it a shot; if you need help, just ask.
I should add an addendum to my previous post. A very important commonality that all spells in diablo 2 have is how they are cast. They are all cast by right clicking on a particular target. Some spells don't even care what the target is (such as poison nova, for instance, which shoots off poison in a circle from the spell caster). But all spells have a cast procedure that takes a target as a paramter (this is either a unit or a coordinate position [the position of the mouse]).
|
|
|
|
|
|
TheOneTrueGod
|
Posted: Sun May 21, 2006 6:53 pm Post subject: (No subject) |
|
|
Thanks for the help, i'm gonna be working on tearing apart the system now, but hopefully itll all turn out better (And I won't give up on it) , but I think you misunderstood my second question. Is it possible to have two classes interact with each other, for (a very simple) example:
code: |
class Unit
%Needed variable declarations go here
procedure CastSpell
new spellArray, upper(spellArray) + 1
new Fireball, spellArray (upper(spellArray))
spellArray (upper(spellArray)) -> Create(myX,myY,whateverelseisneeded)
end CastSpell
%Other functions, whatever...
end Unit
class Fireball
%Needed declarations again
procedure DamageUnit(target : ^Unit)
target -> DamageMe(spellPower)
end DamageUnit
end Fireball
var spellArray : flexible array 1..0 of ^Fireball
var unitArray : flexible array 1..0 of ^Unit
|
Now, I know this code is incorrect and will not work, but is it possible to have both of these things happen through some method, or do I need to have one of them managed in the main loop of my program, like
code: |
if Math.Distance(spellArray(i)->X,spellArray(i)->Y,unitArray(i)->X,unitArray(i)->Y) <= spellArray(i)->Size then
unitArray(i)->DamageMe(10,"Fire")
end if
|
Or am I just ignorant, and my knowledge of linked lists from pascal flawed? (Can I get an example of how this can be done using linked lists if possible?)
|
|
|
|
|
|
Cervantes
|
Posted: Sun May 21, 2006 8:16 pm Post subject: (No subject) |
|
|
I'm having a lot of trouble getting something like this to work, actually. Because of the lack of class variables and because variables must be declared and given a type before being referrenced and because classes cannot be reopened...
Here's what I was thinking, but it doesn't work because of the circular dependance of active_spells and the Spell class:
code: |
var pervasive active_spells : flexible array 1 .. 0 of ^Spell
class Spell
proc create
new active_spells, upper (active_spells) + 1
active_spells (upper (active_spells)) := self
end create
end Spell
|
Then whenever a Unit casts a spell, that spell is created.
I'll think more on it.
|
|
|
|
|
|
Delos
|
Posted: Mon May 22, 2006 2:52 pm Post subject: (No subject) |
|
|
I've been looking through your code, and I mostly like what I see. However, there are a number of issues aside from the important ones Cervantes has listed.
As an idea for your magic system...you have a lot going on there that is hard-coded. Since you're overhauling that part anyway, you could always try to incorporate a system that uses a file to generate the magic from. For instance, in your (encrypted) file, you could define all properties of a magic object, and then initialize it from within your engine. This would mean that the engine would have to be able to handle all the properties of the magic objects (similar to what it does now) but dynamically.
In a similar train of thought, could you not set up your 'Tutorial' to be run from a file instead of having the text hard-coded? Simply a case of incorporating the text (and possibly tags a la UBB for colour etc), and then presenting them.
I'm looking forward to what you'll be doing with this - it, as usual, shows great promise.
|
|
|
|
|
|
TheOneTrueGod
|
Posted: Mon May 22, 2006 4:42 pm Post subject: (No subject) |
|
|
Thanks for the help/tips guys, i'll do my best to implement most of em
I thought about doing the tutorials from an external file, but I don't think it would be easily possible to have the words pop up mid battle. However, In my current version (not posted), I used that concept to display a story (That is, the story is loaded from a file). As for the spells, I overlooked that That would severely reduce the lines of some of my procedures. I'll be sure to use that.
Also, I don't know if you knew about this Cervantes (You probably did, but i'm gonna say it anyways so I feel cool ), but I found a semi way to have circular dependance, A La so:
code: |
class A
end A
var Q : array 1 .. 10 of ^A
class B
inherit A
end B
class C
inherit A
import B, Q
new B, Q (2)
end C
new C, Q (1)
|
This should probably help out a lot, though I don't know about the limitations of it yet.
|
|
|
|
|
|
Cervantes
|
Posted: Mon May 22, 2006 5:05 pm Post subject: (No subject) |
|
|
Yeah, I was thinking about that, where class A was a generic Object class, but then I thought it didn't much make sense to have a 'active_spells' array if I could have a 'objects' array.
It ain't pretty, but it could probably do the trick.
|
|
|
|
|
|
|
|