This is a suggestion for one of our games. You may comment on and rate the suggestion here.
The Suggestion...
Each different type of unit might have a different set of priorities, such as melee units trying to take down ranged fighters, and summoners try to keep mages and melee enemies occupied,(etc).
Merlin would be given a 'random' priority each time a unit looks for a new target.
This system seems like a pretty quick way of searching for an enemy, each way I can think of that might slow it down are kept pretty tidy, the slowest a search might be would be: (number of teams) + (number of enemies in the biggest team), when there is just that lowest priority enemy on the field. This might however, just keep the game running at a pretty constant speed, since other parts would speed up at those times.
Setting a team's priority would be pretty easy, just using the order in which they are listed in the #hates tag, or using the priority system already in place. I'm not sure how many different levels of priority are available with the current system though.
The attack priority for your soldiers could maybe then be set in a menu screen (not in easy mode) where you would set for each soldier type, a tiered list of teams, and another of enemy types(summoner, mage, support(healers/buffs, melee, building, tower(assuming there becomes more towers), ranged (, miniboss?))
I hope sketched sees this, he'd pretty excited about such a system...
Roadmapped by ♪
Relationships with other suggestions
♪ says Dwarf Castle requires this suggestion.Comments
3 comments hidden. Show
If you were to make a new enemy, you would just set its type, and all the other units would put it under that type's priority, and it would get the priority list from the type you associate it with.
On the user friendly part, there would be a set of casts, one for each type, and that would define the types priorities. This way, the editor could make new types and edit them the exact same way as teams.
To Steve, I had the #hates[[],[],[]] in mind for this, but I'm still not entirely familiar with lingo's lists. Can you have as many sub lists as you want? (within reason)(also with the current system)
On the user friendly part, there would be a set of casts, one for each type, and that would define the types priorities. This way, the editor could make new types and edit them the exact same way as teams.
To Steve, I had the #hates[[],[],[]] in mind for this, but I'm still not entirely familiar with lingo's lists. Can you have as many sub lists as you want? (within reason)(also with the current system)
In lingo, yes you can do as many sublists as you like.
The #hates property is expecting 2 levels no more no less just as you have in your example.
Usually all the entries are put in the first sub-list. I ended up not really using this feature in real versions of MR.
To make it more useful, I think it would need to be set per screen.
The #hates property is expecting 2 levels no more no less just as you have in your example.
#hates[[],[],[]]
Usually all the entries are put in the first sub-list. I ended up not really using this feature in real versions of MR.
To make it more useful, I think it would need to be set per screen.
I honestly don't really understand what this suggestion means(if someone could explain,that would be awesome!)But I think its a good idea out of the few comments ♪!
It means that when each character could have preferences for the type of units it wants to fight. For example, you could make melee units go after spellcasters, spellcasters go after ranged units and ranged go after melee.
Oh!Well that sounds cool then!5
So what I'm thinking about ho to work this is by piggy-backing on the team system, giving each character a second "team" which would be its type. such as #team: [#goblins,#ranged]
Then under pTeams(I think that's what it is at least, the list of teams currently on the screen), have each team entry hold a list of the types on the field. Everything else about a type would be handled in the exact same way as would be a team.
Then under pTeams(I think that's what it is at least, the list of teams currently on the screen), have each team entry hold a list of the types on the field. Everything else about a type would be handled in the exact same way as would be a team.
oh cool that would be nice for enemies and troops to hit two teams.
I just hope it won't lag. But it doesn't sound like it does.
I don't think we should piggy back on the teams system. The type of attack should be set by the attack itself merlin has at least two types of attack already - spell caster and melee.
The Hydra changes from melee to ranged when it loses it's second head.
Other units may be given multiple attacks in the future, we need to account for this now.
So perhaps the preferred unit to attack type should also be set by the attack. So you'd get the effect of "when I'm using my bow and arrow, I like to shoot melee units, but when I've got my sword out, I like to go after spellcasters."
The units should probably also be able to choose their weapon based on who is attacking them.
"I'm getting attacked by a melee unit, I better get my bow and arrow out."
The Hydra changes from melee to ranged when it loses it's second head.
Other units may be given multiple attacks in the future, we need to account for this now.
So perhaps the preferred unit to attack type should also be set by the attack. So you'd get the effect of "when I'm using my bow and arrow, I like to shoot melee units, but when I've got my sword out, I like to go after spellcasters."
The units should probably also be able to choose their weapon based on who is attacking them.
"I'm getting attacked by a melee unit, I better get my bow and arrow out."
i dont know steve
Would it be okay for me to manipulate the types in the teamMaster? It seems like the most logical place. (It'll communicate pretty much just through the modWeaponManager)
sounds fine
That's really directed towards steve...
Also, fitting spawns in might be difficult, seeing as they have no weapon! I'm going to have to find me some way around that...
Actually, I might try to set it up such that the weapon used alters the type, but the type is set by the character.
So a character defaults to a certain tye, and when he changes weapons, the weapon changes his type.
So a character defaults to a certain tye, and when he changes weapons, the weapon changes his type.
So you mean if skeletons change from sword to bow so like melee to ranged?
Yes, I'm absolutely sure he means exactly that.
Well, you can try whatever you like - if it works, send it to me, if not, er, don't. :)
Sure thing!
Woohoo!
Status update: this is around half done. Currently, the is a sublist of each team that describes what types it has, in terms of numbers and a reference to each character on that team, of that type. Thus, the targeting system is done, and I have a feeling, a little faster than before (I set it to not search through teams that are void). Still to do is write atkTypes into all the character/weapon data, and allow weapons to manipulate a character's atkType.
Should be done within the week. Also, steve, did you use a script of some sort to transfer all the casts to txt files? ...cause I'm working in mrOpen 20. (ease of use until Super_merlin gets done)
Should be done within the week. Also, steve, did you use a script of some sort to transfer all the casts to txt files? ...cause I'm working in mrOpen 20. (ease of use until Super_merlin gets done)
Wait Note,can you add the dwarf castle thing or is that up to Steve?
Not to tell you what to do, but you really should work on the latest one.
You can still work from inside Director, just run
saveScripts()
from the message window to export your scripts before running (and reloading).
Or alternately just edit the text files directly.
Otherwise it's going to give me a headache to try to merge your changes in.
However, if you really can't do that (I admit I haven't tried it myself), go ahead and I'll do my best with whatever you send me.
You can still work from inside Director, just run
saveScripts()
from the message window to export your scripts before running (and reloading).
Or alternately just edit the text files directly.
Otherwise it's going to give me a headache to try to merge your changes in.
However, if you really can't do that (I admit I haven't tried it myself), go ahead and I'll do my best with whatever you send me.
I was thinking of copy-pasting my changes over, or redoing it in the newer one(once I had gotten a good grasp of it)
I'm thinking I should leave findNearest() the way it is, and call it in the ai to determine which weapon a multi-attacked enemy might want to use.
I'm thinking I should leave findNearest() the way it is, and call it in the ai to determine which weapon a multi-attacked enemy might want to use.
so, right about now, I have two options about where to put call a joinType(weapon.atkType) kinda function (which would change the attack type of a character). One, which would be faster(in the code deciding which attack to use->drawback: needs to be written again in each method of deciding to change attacks), and one which would be easier to manipulate in the future(in the setAttack() of pretty much every character->drawback:it would be called for each character with an attack, overwriting the same info that they already have)
There is a third option which would be to add a second argument to the setAttack, which would determine whether or not to update the type, but it may prove very timely to find every instance of setAttack being called.
I think I'll do the first option for now, just to get it working (Then I think I might overhaul the multiple attack system so it gets done by type)(Add types like longRanged or shortRanged and such:) )
There is a third option which would be to add a second argument to the setAttack, which would determine whether or not to update the type, but it may prove very timely to find every instance of setAttack being called.
I think I'll do the first option for now, just to get it working (Then I think I might overhaul the multiple attack system so it gets done by type)(Add types like longRanged or shortRanged and such:) )
What is >drawback,weapon.atktype,setAttack?
problems with each option;)
Could you explain these problems?
You could add the second parameter, then have a default behaviour if it is not set. Something like
It's a useful thing to be able to do. Other languages handle it better but there we are.
on setAttack(typ, update)
if voidP(update) then
update = false
end if
-- rest of function
end
It's a useful thing to be able to do. Other languages handle it better but there we are.
@ Steve
Egad! Is that director code. It's like the horror of BASIC all over again.
I must have a C syntax.
Egad! Is that director code. It's like the horror of BASIC all over again.
I must have a C syntax.
Whats a C syntax?
If and while loop in C.
#include
int main()
{
int a;
int b;
a=5;
b=a+5;
if(a==5)
{
printf("Hello! A is 5);
}
while(b==10)
{
printf("Endless loop!!!");
}
}
If and while in BASIC. I don't know to much. This is just pseudocode.
a=5
b=a+5
if a ==5 then
say "A is 5"
end if
while b==10
say "Endless loop"
end while
Obviously, C syntax uses {}{}{}, while that other one uses end if, end while, and such.
#include
int main()
{
int a;
int b;
a=5;
b=a+5;
if(a==5)
{
printf("Hello! A is 5);
}
while(b==10)
{
printf("Endless loop!!!");
}
}
If and while in BASIC. I don't know to much. This is just pseudocode.
a=5
b=a+5
if a ==5 then
say "A is 5"
end if
while b==10
say "Endless loop"
end while
Obviously, C syntax uses {}{}{}, while that other one uses end if, end while, and such.
I don't think director has whiles...
The again, I don't really know lingo that well.
The again, I don't really know lingo that well.
One thing I kinda do like with the non-C syntaxes is the lack of semi-colons.
Yeah, but then you can't do this:
printf("Hello World!");if(500==500) printf("500 is 500);printf("Number: ");scanf("%d",&x);
I got used to semicolons.
printf("Hello World!");if(500==500) printf("500 is 500);printf("Number: ");scanf("%d",&x);
I got used to semicolons.
printf("He
llo Wo
rld!");500==500? printf("500 is 500): ;printf("Number: ");scanf("%d",
&x);
...
llo Wo
rld!");500==500? printf("500 is 500): ;printf("Number: ");scanf("%d",
&x);
...
... so I now have a pretty basic setup for priority targetting. I'm still trying to optimize it/ make it work exactly how I want it to. Its not remarkably faster or slower than before, but I haven't tested it in terms of extrem cases. I'll get a demo of it up in a couple of days.
@Super_merlin I think the fact that you can't do that is a good thing! More readable code. Lingo also has a JavaScript type syntax but they only added that in Director 8. Since I had already programmed the rest of MR in the older syntax I stuck with it for consistency.
But if ♪ or anyone else wants to start using the JavaScript syntax for stuff. I won't mind so long as it formatted with one command per line.
In Lingo you use repeat for loops
But if ♪ or anyone else wants to start using the JavaScript syntax for stuff. I won't mind so long as it formatted with one command per line.
In Lingo you use repeat for loops
-- for loop
repeat with i=1 to 10
put i
end repeat
-- foreach loop
data = ["steve", "Super_merlin", "note"]
repeat with name in data
put name & " is cool"
end repeat
Wow these codes are confusing.
What is lingo?
@Super_merlin hehe, sorry just got a bit freaked out there.
@crazymerlinman321 Lingo is the programming language of Director and Shockwave.
@crazymerlinman321 Lingo is the programming language of Director and Shockwave.
Open question, just curious about people's opinions (although this has been sort of addressed by Steve anyway):
A friend of mine who is studying game design at university says that languages like Lingo (writing the code out sort of like a sentence) are "silly". Or something similar; they're not given wide credit. Is this a reasonable comment? What are the reasons for and against lingo-style?
A friend of mine who is studying game design at university says that languages like Lingo (writing the code out sort of like a sentence) are "silly". Or something similar; they're not given wide credit. Is this a reasonable comment? What are the reasons for and against lingo-style?
Well, other languages are more popular, but it doesn't matter. I just personally don't like it.
Why don't you like it Immortal_merlin?
Personal Preference.
Ok
I'd be willing to say that the only programming languages that wouldn't be considered 'silly' would be assembly-languages.
thanks for pointing that out.
Egad! I took a look at assembly language once. I almost killed myself.
Second-year software engrs have to write battleship in assembly.
The difference is whether the language takes notice of whitespace in it's formatting.
My personal favourite language is PHP which is a non-whitespace language. Hence, lots of semi-colons and curly brackets. It comes in very handy when you want to format a large string over several lines. JavaScript, C#, C++, ActionScript, Perl and even Lingo (in it's JavaScript like form) come under this category.
Whitespace languages tend to have cleaner formatting (they don't look like and explosion in a punctuation factory) and include languages such as Py-thon, Visual Basic, VB Script (classic asp), Amos Basic, in fact all Basics and of course Lingo.
That Lingo comes in both categories should show you though that you can't judge a language by it's syntax and that's all we are really talking about here. PHP is head and shoulders above VBScript but it's not because of whitespace, it's because it's way more featureful and gives you much, much more feedback when things go wrong.
Py-thon is an excellent, whitespace based language. I think a lot of the attitude towards them is because of their association with Basic. And that, in my opinion is just silly.
My personal favourite language is PHP which is a non-whitespace language. Hence, lots of semi-colons and curly brackets. It comes in very handy when you want to format a large string over several lines. JavaScript, C#, C++, ActionScript, Perl and even Lingo (in it's JavaScript like form) come under this category.
Whitespace languages tend to have cleaner formatting (they don't look like and explosion in a punctuation factory) and include languages such as Py-thon, Visual Basic, VB Script (classic asp), Amos Basic, in fact all Basics and of course Lingo.
That Lingo comes in both categories should show you though that you can't judge a language by it's syntax and that's all we are really talking about here. PHP is head and shoulders above VBScript but it's not because of whitespace, it's because it's way more featureful and gives you much, much more feedback when things go wrong.
Py-thon is an excellent, whitespace based language. I think a lot of the attitude towards them is because of their association with Basic. And that, in my opinion is just silly.
Ya i have started using py-thon
To be fair, in defence of my friend, he loves py-thon and has on several occasions encouraged me to learn it.
and you've learnt it?
Hey. I'm the sponger, not the useful guy. I don't do things.
Didn't you write what was on the lore stone?
Did he?I wasn't here back then.
I dunno did he?
Darren,did you?
I would put up files for some speed enhancements, but it seems that tmb14 is still down. :( if anybody really wants to, they can make functions in the "general functions" cast library, for geomDistSqr and geomHypSqr, which are just like geomDist and geomHyp, but don't square anything, then start searching through teamMaster, modAttack, structMaster (change targetDetails' default distance to be much bigger, like 99999 or something, objMine, objAiCPU, modSplashDamage, modMoveToLoc, modBuilder, modWeaponMaster(and I think that's all of them) and anywhere you find geomDist() and its result is compared to another number, replace it with geomDistSqr() and square the number you are comparing it to. Team master is the exception to that, and you really want to take the square root, and move it out to the function(s) that is just before sending it back to modAttack. (I'm still not entirely sure if the square root is even necessary; I keep seeming to forget to deal with the healblast, which uses the health as though it were a distance in finding targets)(I'll fix that before posting, I guess)
Speed-wise, it would also probably be nice to find some bitwise alternatives to squaring and rooting numbers(provided there are bitwise solutions and that lingo can bit-bash)
Speed-wise, it would also probably be nice to find some bitwise alternatives to squaring and rooting numbers(provided there are bitwise solutions and that lingo can bit-bash)
Ooh, this is cool: http://www.bitwisemag.com/copy/wilf/wilf1.html
That's neat. I love cool math stuff like that.
This may also prove helpful for some speed optimization: http://www.dattalo.com/technical/theory/sqrt.html
or "Fast inverse square root" which would still require a (computationally heavy) division.
or "Fast inverse square root" which would still require a (computationally heavy) division.
and I think that this may be the one of the best solutions I've come across! Now why didn't I learn how to do square roots by hand in junior high!
hmm, apple papers seem to be telling me that the "by hand" one is still pretty slow ->0(n), where n, I assume, is the number of digits.
Always have wondered how calculators do square roots. In my math book, it says to use the table in the back or approximate.
That.. That article(the last one)... Wow.
Never actually thought about stuff like that, I had some of my own methods, but they were a bit inaccurate and stuff.
Never actually thought about stuff like that, I had some of my own methods, but they were a bit inaccurate and stuff.
@steve, I dunno. Did I? I don't even remember what the stone said.
Ok a few questions. What are the following?
tmb14
cast library
geomDistSqr
geomHypSqr
geomDist
geomHyp
teamMaster
team (not the team like in soccer team)
modAttack
mod
structMaster
struct
targetDetails
default distance
objMine
objAiCPU
modSplashDamage
modMoveToLoc
modBuilder
bit - bash
Whitespace
tmb14
cast library
geomDistSqr
geomHypSqr
geomDist
geomHyp
teamMaster
team (not the team like in soccer team)
modAttack
mod
structMaster
struct
targetDetails
default distance
objMine
objAiCPU
modSplashDamage
modMoveToLoc
modBuilder
bit - bash
Whitespace
tmb14 is the collaboration bit; where everybody can put up maps and the like, I think you had email problems with it?
The cast library is an organization of information used by Director. Steve has it organized into a couple categories, being: gfx(houses all the bitmaps), general functions(a bunch of functions of his own creation, for finding stuff like the distance between two characters; they get used pretty often, and are non-specific to any one user)(you put in some numbers, and out plops an answer), masters(they operate globally, that is to say, they work the general aspects of the game, like keeping track of how many characters are in the room, drawing sprites and the like), script objects(defines behaviours of various different types of characters, and modules (mod) which add extra functionality), and data, which holds relevant information for the various teams and characters to run the script objects.
For whitespace, you can look at TMOW's spam page additions--a bunch of spaces or tabs, that don't *usually* change how a program runs.
Would you like an in depth, as far as I can describe of each of those mods, masters and functions you listed above?
A team in mr describes a characters allegiance, such as #aldevar, which is merlin and all his friends. They target definable other teams, such as the undead(the skelitons and skeletons and necromancers) and the goblins et al.
The cast library is an organization of information used by Director. Steve has it organized into a couple categories, being: gfx(houses all the bitmaps), general functions(a bunch of functions of his own creation, for finding stuff like the distance between two characters; they get used pretty often, and are non-specific to any one user)(you put in some numbers, and out plops an answer), masters(they operate globally, that is to say, they work the general aspects of the game, like keeping track of how many characters are in the room, drawing sprites and the like), script objects(defines behaviours of various different types of characters, and modules (mod) which add extra functionality), and data, which holds relevant information for the various teams and characters to run the script objects.
For whitespace, you can look at TMOW's spam page additions--a bunch of spaces or tabs, that don't *usually* change how a program runs.
Would you like an in depth, as far as I can describe of each of those mods, masters and functions you listed above?
A team in mr describes a characters allegiance, such as #aldevar, which is merlin and all his friends. They target definable other teams, such as the undead(the skelitons and skeletons and necromancers) and the goblins et al.
Yes, I would like the explanations to be as in depth as possible. :)
in the form of interfaces?
Whatever would be comfortable for you to do.
Hmm, you may just want to read steve's comments at the top of each file(you should probably be able to figure out at least a little bit of what each one does by perusing them). My additions (geomDistSqr and geomHypSqr, only use part of pythagoras, to determine a comparable set of "distances" rather than find the actual distances that two things are apart from one another.
...With reference to the struct (structure) master and the default distance, the struct master sets default values for various objects if there is no other data to use(so to speak). It helps cut down on time for writing out new characters, attacks and the like. The default distance in target details struct also seems describes the maximum possible distance two things can be calculated in the targeting algorithms. Since the distances to be compared are now the square of what they would've been, this number starts to effect the targeting, reducing the distance at which two characters will target one another, thus, it needs to be made larger.
Bit-bashing is the use of various operators to alter the actual 1s and 0s that represent data in the computer. I don't entirely feel like explaining binary and logic gates so I think I'll leave it at that.
...With reference to the struct (structure) master and the default distance, the struct master sets default values for various objects if there is no other data to use(so to speak). It helps cut down on time for writing out new characters, attacks and the like. The default distance in target details struct also seems describes the maximum possible distance two things can be calculated in the targeting algorithms. Since the distances to be compared are now the square of what they would've been, this number starts to effect the targeting, reducing the distance at which two characters will target one another, thus, it needs to be made larger.
Bit-bashing is the use of various operators to alter the actual 1s and 0s that represent data in the computer. I don't entirely feel like explaining binary and logic gates so I think I'll leave it at that.
Ok thounsand thanks note!
tmb14 - my last attempt to replace this website. This is tmb08a. That shows you how often I have tried and failed to replace this site. I have given up and will simply work on improving this site
cast library - a collection of 'members' stored in a director file. Director uses a theatre metaphor. The screen is the stage, sprites are actors, a cast is collection of assets, an asset (a bitmap, sound, bit of code) is a member
geomDistSqr
geomHypSqr
geomDist
geomHyp
teamMaster - the object that keeps track of who is in which team. When a character in the game is looking for someone to fight, they ask teamMaster to find them the nearest enemy.
team (not the team like in soccer team) - All characters in MR are on teams. eg aldavar(wizards) goblins, undead etc
modAttack - a module which is attached to a character object that allows them to attack other characters
mod - a module. a small object which can be attached to bigger objects to give them extra characteristics
structMaster - an object holding data structures - really just associative arrays which particular properties defined.
Have to stop dinner is ready!!
struct
targetDetails
default distance
objMine
objAiCPU
modSplashDamage
modMoveToLoc
modBuilder
bit - bash
Whitespace
cast library - a collection of 'members' stored in a director file. Director uses a theatre metaphor. The screen is the stage, sprites are actors, a cast is collection of assets, an asset (a bitmap, sound, bit of code) is a member
geomDistSqr
geomHypSqr
geomDist
geomHyp
teamMaster - the object that keeps track of who is in which team. When a character in the game is looking for someone to fight, they ask teamMaster to find them the nearest enemy.
team (not the team like in soccer team) - All characters in MR are on teams. eg aldavar(wizards) goblins, undead etc
modAttack - a module which is attached to a character object that allows them to attack other characters
mod - a module. a small object which can be attached to bigger objects to give them extra characteristics
structMaster - an object holding data structures - really just associative arrays which particular properties defined.
Have to stop dinner is ready!!
struct
targetDetails
default distance
objMine
objAiCPU
modSplashDamage
modMoveToLoc
modBuilder
bit - bash
Whitespace
Thank you Steve!
struct - a "structure" of data, similar to having a list/array, except that they can hold multiple types(such as a number, a decimal, string of letters, etc), depending on how you define your struct. Effectively, it holds under its variable name, several sub-variables so to speak, where each sub-variable name holds a specific kind of data. An analogous system is how all the files in your computer are arranged in folders. The folder is like a struct, containing files(variables) and other folders(other structs, which contain even more variables)(also(@steve), about the associated arrays bit, the more I look at "property lists," the more I think of them as hash tables, which may not be altogether a good thing)
Target details - a struct that defines some information about a potential target when a character is looking for someone to attack. For the most part, its got the object that this data is associated with, its distance from the attacking object, and it might have some other stuff that's currently slipping my mind.
ModSplashDamage - allows objects its attached to
to hit multiple ennemies at once, within the attack's range.
ModMoveToLoc - lets things move, it also holds some information about its state of motion and where its going/when it gets there.
ModBuilder - let's objects that its attached to put up buildings, and I think controls their ai, although that might be elsewhere, like a objAiCPUBuilder or something like that.
objAiCPU - (I think, although this might be something else) Defines the default behavior for a character, it can have modules attached to it for extra functionality/more things that it *could* do.
objMine - describes the behaviour of a mine, exploding(-ish) and whatnot. Examples of characters that use this ai: energy mines, fire, pit monsters. (very loose definition of "explosion")(hehehe)
**team (as in the team like in soccer team) - All characters in MR are on teams. eg aldavar(wizards) goblins, undead etc
**correction. :)
Target details - a struct that defines some information about a potential target when a character is looking for someone to attack. For the most part, its got the object that this data is associated with, its distance from the attacking object, and it might have some other stuff that's currently slipping my mind.
ModSplashDamage - allows objects its attached to
to hit multiple ennemies at once, within the attack's range.
ModMoveToLoc - lets things move, it also holds some information about its state of motion and where its going/when it gets there.
ModBuilder - let's objects that its attached to put up buildings, and I think controls their ai, although that might be elsewhere, like a objAiCPUBuilder or something like that.
objAiCPU - (I think, although this might be something else) Defines the default behavior for a character, it can have modules attached to it for extra functionality/more things that it *could* do.
objMine - describes the behaviour of a mine, exploding(-ish) and whatnot. Examples of characters that use this ai: energy mines, fire, pit monsters. (very loose definition of "explosion")(hehehe)
**team (as in the team like in soccer team) - All characters in MR are on teams. eg aldavar(wizards) goblins, undead etc
**correction. :)
Thank you alot note and Steve! One more thing, ai is accuarcy right?
The abbreviation AI means Artificial Intelligence, which would mean that the AI of a object is what decides what the object will do.
I think Steve has kept the same meaning in his code.
I think Steve has kept the same meaning in his code.
Yep, and if you are ever looking through the code, charcterPrgs or something similar to that (character programming) refers to a character's ai object. The other big one that gets used pretty often is ID.BigMe which refers to the objGameObj(or something with a similar name) which takes care of game objects.
There was a funny thing in warioware: DIY, which let's you make microgames of your own.
Well, it's sort of like programming with basic, only through funky menus and the base structure is of course done for you.
Anyway, it has a distinct consept of thinking about a game as a play. A play requires usually the following(according to the game, at least): The stage, the actors, the script and some music. It then moves on to think of the game in a similar manner - the stage is your screen, the actors are the objects, music is sound effects and BGM and the script is the AI, which is then applied to the objects.
I guess it works for those who never have programmed to get the consept of making the microgames.
Well, it's sort of like programming with basic, only through funky menus and the base structure is of course done for you.
Anyway, it has a distinct consept of thinking about a game as a play. A play requires usually the following(according to the game, at least): The stage, the actors, the script and some music. It then moves on to think of the game in a similar manner - the stage is your screen, the actors are the objects, music is sound effects and BGM and the script is the AI, which is then applied to the objects.
I guess it works for those who never have programmed to get the consept of making the microgames.
I think associative arrays actually are hash tables. I think the name varies depending on the programming language
c++ - hash tables (?)
php - associative arrays
lingo - property lists
php
lingo
Someone do C++?
c++ - hash tables (?)
php - associative arrays
lingo - property lists
php
$steve = array('name'=>'steve', 'age'=>35);
lingo
steve = [#name:"steve", #age: 35]
Someone do C++?
would you like a really, really simple one? a table of unsigned chars, cannot hold 255.
class table{
Public:
bool add(unsigned char item);
unsigned char find(unsigned char item);
unsigned char remove(unsigned char item);
Private:
char storage[255];
int hashFunction(unsigned char item);
}
table::table
{
for(i = 0; i < 255; i++;
storage[i] = 255;
}
int table::hashFunction(unsigned char item)
{
return (int) item;
}
bool table::add(unsigned char item)
{
if(item == 255)
return false;
int stored = hashfunction(item);
if(storage[stored] == 255)
{
storage[stored] = item;
return true;
}
else return false;
}
unsigned char table::find(unsigned char item)
{
stored = hashFunction(item);
return storage[stored];
}
unsigned char table::remove(unsigned char item)
{
stored = hashFunction(item);
temp = storage[stored];
storage[stored] = 255;
return temp;
}
Where the hashing function is nothing but the character itself!
class table{
Public:
bool add(unsigned char item);
unsigned char find(unsigned char item);
unsigned char remove(unsigned char item);
Private:
char storage[255];
int hashFunction(unsigned char item);
}
table::table
{
for(i = 0; i < 255; i++;
storage[i] = 255;
}
int table::hashFunction(unsigned char item)
{
return (int) item;
}
bool table::add(unsigned char item)
{
if(item == 255)
return false;
int stored = hashfunction(item);
if(storage[stored] == 255)
{
storage[stored] = item;
return true;
}
else return false;
}
unsigned char table::find(unsigned char item)
{
stored = hashFunction(item);
return storage[stored];
}
unsigned char table::remove(unsigned char item)
{
stored = hashFunction(item);
temp = storage[stored];
storage[stored] = 255;
return temp;
}
Where the hashing function is nothing but the character itself!
Wow, don't really understand what's going on.
So, you have to program your own in C++? Blimey.
I have no idea what there is for pre-made hash tables in C++, but for the best results, you'd probably want your own implementation anyways?
There might be something like "table"...
...it seems there is an MSDN for a hash map, which looks to be the same thing as a property list.
There might be something like "table"...
...it seems there is an MSDN for a hash map, which looks to be the same thing as a property list.
Steve: You've obviously never had fun with C.
I love C. Do everything yourself, and it's 5 times as fun as using the standard library. Not that it actually has all that much.
I love C. Do everything yourself, and it's 5 times as fun as using the standard library. Not that it actually has all that much.
I made my own queue to teach myself how to do classes, or rather I taught myself C++ classes by doing a queue? It was/is for a high speed data transfer kinda thing(whoo overlapped IO) ;)
Sounds fun! I'm certainly not averse to creating objects to re-create features that I'm used to having in other languages.
Can't wait to see C, but of course I must master python.
or, if you've got the gyst of the basic operators(stuff like ifs, fors, whiles, etc), you can switch without learning python! Then you can learn the joy of pointers! (Super_merlin may be more adament towards learning one language)
I better just focus on Python.
Anyways...note are you almost finished with the targeting thing.
No brew, I'ma takin' a break!(and getting people organized to come round and record now and then seems to be a particularly demanding task, then again, what should've been Jazz fest is now getting to be over (I think I might be seeing Nikki Yanofsky tomorrow!) I may get back to some programming, however, it may be difficult to post some of the code changes without the collaboration bit! (Maybe I'll just get to something easy, such as adding enemies?)(And perhaps some tiles?)
So how far are we in this thing? Halfway?
Idea to make this really simple: calculate priorities as an amount to deduct from the distance between the character and its target. (Will be roughly the same speed as without priorities)
You must be logged in to add a comment.
Rating: 5.00 in 3 votes
Status: rate | *In Roadmap*
Priority Based Targeting