Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Too many requirements to write.

Author
Message
Jachan19
15
Years of Service
User Offline
Joined: 1st May 2011
Location:
Posted: 1st Apr 2013 03:08 Edited at: 1st Apr 2013 03:12
What my topic means is that I am thinking to have some monsters be able to evolve into almost-double-of-its-amount (let's say, 5 basic monsters could able to evolve into 10 evolved monsters) while 1/4 of those evolved monsters are able to be evolved by more than one basic monster.
Let's say with this example... From A to E are Basic and F to O are Evolved and from my topic title, they all have stats to check to see if the current Basic monster's stat is enough higher than the required stats in the Evolved monster's stat if that Evolved monster is able to be evolved from this current monster... or otherwise that Evolved monster would be ignored (let's say, cat monster don't evolve into dragon monster). Anyway, here the example is... I am just pretending the monsters as animals though, for easy to understand the chart.



Since A to E are Basic and can evolve into F-to-O monsters, I am charting this way...

A can evolve into either F, G, or K
B can evolve into either G, I, or N
C can evolve into either H, L, or M
D can evolve into either I, N, or G
E can evolve into either J, O, or M

That's where my problem come in... I feel like I want to write the commands / function to check the whole stats of "current monster" (in this case, Basic) to each possible Evolved monsters that the current monster can evolve into. If my monster is Cat ( A ), it can evolve into either Lion or Cheetah or Cebereus but only one of them will be evolved by passing all requirements... I am including all stats as well as the hunger and weight and care-mistakes; which it would be more likely this way... Look at Lion and Cheetah... Lion is focused on ATK / STR (Attack / Strength) and some big Weight while Cheetah is focused on SPD (Speed) with less Weight... If I would like to evolve Cat into Cheetah instead Lion, I would watch out for its weight to be overfed (more weight to feed) while watch out for Lion's required ATK (which means Cat's ATK must be less than Lion's ATK to make Lion be skipped to check)

In other word, I would like to write like this...
each-current-stat >= each-evolved-stat
but I used the stats as "TYPE" things (Monster.Current.STR, Monster.Current.SPD, Monster.Current.Weight, etc), so it would be very tough to check each evolved monster that is possible to be evolved from less-than-Evolved-numbers (5 < 10) Basic.

I don't want to write too many "IF" commands (equal to all needed stats to check) in each evolved monster (trust me, it might be OVER 100 monsters, so... that's the problem I encounter)... Is there any narrower function to check all multiple stats at once for EACH evolved monster before confirming to evolve into?
Or do I have to suffer to write million "IF" commands for all monsters to check each stat? =/

By the way, I already tried to test the DATA, RESTORE, and READ command, it didn't work this way.

Thank you for your help in either way, to find a possible solution or not.

Edited: I guess multiple spaces between ABC won't work in posts, so I edited them from one row instead 3 x 5
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 1st Apr 2013 04:20 Edited at: 1st Apr 2013 04:25
That's quite advanced; there are different ways for checking what can evolve into what. Arrays, binary, function pointers, script or XML to determine what can evolve into what, you just need to choose what avenue you want to learn, if not the avenue you are comfortable with.

I demonstrated determining whether an animal can be classified as a mammal, aquatic, feline, cat or human or a combination using binary calculations here; but I think that might be a little advanced.

An easier to understand method is to give each monster its own array, and store what the monster can change into. You could also link each array entry to a given monstor; use a link list, or store the array in a memblock so that each monsters details are linked accordinly.

For example, monster A is assigned array A. Species A, B and C are stored in array A; to check that monster A can become B or C; search its array for B or C.

In 32bit binary (32 slots) this would work like this: A = A or B or C. And is checked like this: If A and B Then ...

In 64bit binary (or 64 slots, which requires Matrix1), what A can change into is done using bit masks; outlined in the Matrix1 help files.

Jachan19
15
Years of Service
User Offline
Joined: 1st May 2011
Location:
Posted: 1st Apr 2013 04:42 Edited at: 1st Apr 2013 05:03
Hello Chris. I am getting a little understanding but "species" is not what I would like to solve my problem, actually. it's just an example, for sure.

But are you saying that I should make each monster in array as "ID#" (or ID$ if you suggested this correctly instead ID#) and then design all evolved monsters's IDs in the chart under IF command?


Is that the one you mean?

P.S.: Yes, I know it's advanced but at least, I can learn something advanced pretty quickly to improve much faster to finish the game I am programming, so... yeah.

EDITED:
I just found the chart you made as I overlooked (was looking for pictures only, not texts)... I see what you mean by connecting between two monsters (in your case, animals)... but it might take long digits to return and could be higher chance to make mistakes in end, however...
I mean, it's not like only two; Basic and Evolved... I am making it have more than two, as if it's like pokemon / digimon evolution, that it would able to evolve more until either time run out while failing to meet the whole requirements (monsters have lifespan, by the way) or while current monster is already at final stage to evolve...
Or is there any tip for me to make easier to design this method Boolean & Flags as well as to lessen the mistakes chance?
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 2nd Apr 2013 13:27
Quote: "I am making it have more than two, as if it's like pokemon / digimon evolution"


You really need someone with pokemon experience, please don't expect me understand anything about pokemon lol; I am useless with pokemon / digimon stuff.

Is there a YouTube video somewhere I can watch so I can understand what you are trying to do? The more I understand, the better I can help.

If you can't find any video, then point me to an instruction manual that explains it.

Then I will study it and point you in the right direction.

Jachan19
15
Years of Service
User Offline
Joined: 1st May 2011
Location:
Posted: 2nd May 2013 23:09
I will try to find something to make you understand more if possible. But there is a "FAQs guide" that might be much easier for you to read instead watching, actually. Like i said "as if it's like Digimon evolution", this guide page should have full list of "how to evolve into what you want" task.
Do you think we can PM or something? I don't want to get any bots in here or spams in my emails.

Sorry for late reply, I didn't realize you replied back yet.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th May 2013 15:32 Edited at: 8th May 2013 15:34
I had one of those Digimon things as a kid. It was a virtual pet that you could train and then link with your friends to fight theirs. Depending on how well you trained and cared for the pet it would "evolve" into one of several monsters on the tier above. There were some really crappy monsters to evolve into if you did badly, I remember there being a slug for example. Don't forget to put in those kind of forfeit monsters.

One possibility is to have radically different lineages that would offer completely different gameplay: maybe your starting monster could evolve into an animal or a plant and either lineage would require very different care.

Maybe you could even go super-meta and have a sort of ecosystem where certain monsters can only evolve if other certain monsters already exist. For example, a Lion might evolve from a smaller cat, which would require birds to eat; the birds would have been evolved in a separate game by the player and would require insects and plants to eat which must also be evolved by the player.

Creating an ecosystem like this would allow higher monsters to be evolved, but it would also limit the types of higher monsters available depending on how you built the ecosystem, because not all species can live in the same habitat.

So you'd be managing this ecosystem that keeps growing and getting more complex just to try and produce the strongest monsters. That sounds pretty cool to me.

The difficulty in learning is not acquiring new knowledge but relinquishing the old.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th May 2013 15:56
I would start with a simple matrix first, and worry about meeting evolution criteria later.

Like, give each animal a number starting with 0, and make a 2D array with the same number of XY elements as there are animals, and this can be used to cross reference the animals with each other.

So you'd check animal A on the X column, against all the animals on the Y column - maybe the array just has a 0 or 1 for if the animal can evolve into it, but you could of course make that clever, have the value be a factor for XP - maybe that has the XP requirement to evolve into that animal... or a percentage. The most powerful monsters should be the most difficult requirements to meet, make people work for the best evolutions.

Perhaps even show disabled animals that can be evolved into, but the XP requirement isn't there yet - then people would see if there's a better evolution worth waiting for.

I'd make some functions to take a specified animal and add evolution options - I'd also enumerate it separately, like refer to the animals by name, not number - for the sake of your own sanity.... you would just check a specified animal name against the animals data array (I'm guessing you have one). This might sound like a step too far, or like it might slow things down too much - but seriously, you'd be glad you did it after going through just the basic evolution matrix. You want to specify Cat can evolve into Tiger, Lion, etc etc etc - not that 3 can evolve into 8 25 and 57.

Also... maybe animals should be able to evolve regardless of stats - but then any stats that are lacking might affect the evolved animal detrementally. Like - if a cat is really big and strong, it would make an awesome tiger, but a pretty terrible Cheetah - but maybe that's a mistake the player should be allowed to make. It would add depth I think, and encourage people to nurture their animals to get the best monsters that they can. Like, perhaps the stat's of the animal are multiplied for the monster, great stats on an animal mean great stats on the evolved monster. Just a thought.

I got a fever, and the only prescription, is more memes.
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th May 2013 17:12
How about this:

Make a multi-dimensional array, each dimension covers a different attribute, for example: [3,2,5] might be strength-3, agility-2, water affinity-5. An extra dimension would be used to list all the monsters that can have those stats. When an evolution check is triggered the array is referenced and a random monster chosen from the list.

The difficulty in learning is not acquiring new knowledge but relinquishing the old.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 9th May 2013 15:59 Edited at: 9th May 2013 16:03
First you want to make a reference class for all your monsters, which is a database for storing all base information for your monsters. In that class include Evolutional Required Stat Ranges. Instead of checking if a stat is greater than or less than, use a range to see if it's within the necessary values.

I would use linked lists to link evolution possible monsters to whatever it's evolving from but it's slightly advanced so use arrays or whatever you can think of. Then in a simple function you'd just check if one of the monsters is in the correct range to evolve.

When we check, we assume from the start that it's valid for evolution, then we check to see if it fails. The reason for this is if we check to see if everything is valid instead, you'd have to check every single possible combination of required checks for evolution.

And here's how I would check for every combination possible:


What's handy about this is you can easily add any number of stat checks to this to add more diversity to evolving by simply adding under the last check.

"Get in the Van!" - Van B

Login to post a reply

Server time is: 2026-07-07 12:27:34
Your offset time is: 2026-07-07 12:27:34