It is currently Tue Jan 19, 2021 10:11 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Functions needed: TerrainType, HexHeight, GrassHeight
PostPosted: Mon Aug 03, 2009 8:48 pm 
Offline
Moderator
Moderator
User avatar

Joined: Fri Jan 13, 2006 6:20 pm
Posts: 2325
Location: Argentina
I'll describe what these functions could do, and why I think they are important:


TerrainType(x,y)=Type

Where type can be: earth, needles, don't enter, don't enter water, water, don't enter rock, rock, swamp, snee, road, bank.

Its important because it can tell lots of things: if the unit will be slowered down while crossing, if its a good or bad place to build something, etc.


HexHeight(x,y)=Height

Where height is the actual height of the specified hex.

Its important because it can help with the following: checking if the position is good for building defenses, if the position is optimum for a recon to go (level of the field of view), etc.


GrassHeight(x,y)=Height

Where height is the actual height of the grass on the specified hex.

It is important since it would be very useful for checking some of these things: If a unit will be slowered down when crossing it, if it will have good or no cover at all, etc.



In addition, these three functions could be used in conjunction with arrays, and return a list, for bigger areas (for instance, you want to build a lab, and you need to check more than 1 hex).



As final words, I can say that these three tools can help much when it comes to AI or anything else wich requires getting extra information about an hex, and therefore they would be very useful for advanced coding, if properly implemented.

_________________
-Aleph.

THE Very active person

"You can only do well at something if you put the time in. Doesn't matter what subject it is. You can't make a master piece over night."
Wise man Stu-


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 03, 2009 10:16 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Mar 17, 2008 6:03 pm
Posts: 1130
Location: Denmark
AGREED
For developing a more advanced AI, functions like those would be indispensable.

About the GrassHeight function: The function must in some way tell if the grass is trampled if you want to use the function for checking if the hex is good for taking cover.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 04, 2009 12:16 am 
Offline
Moderator
Moderator
User avatar

Joined: Fri Jan 13, 2006 6:20 pm
Posts: 2325
Location: Argentina
McBenn wrote:
AGREED
For developing a more advanced AI, functions like those would be indispensable.

About the GrassHeight function: The function must in some way tell if the grass is trampled if you want to use the function for checking if the hex is good for taking cover.


Its very good to see my suggestion is useful.

Maybe GetTrampledGrass(x,y)=Boolean ?

_________________
-Aleph.

THE Very active person

"You can only do well at something if you put the time in. Doesn't matter what subject it is. You can't make a master piece over night."
Wise man Stu-


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 04, 2009 9:22 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Mar 17, 2008 6:03 pm
Posts: 1130
Location: Denmark
gwren1 wrote:
Maybe GetTrampledGrass(x,y)=Boolean ?


Dunno if that is enough ... there are several degrees of trampled grass (completely trampled, raised a bit, half raised etc.). It's gonna be quite comprehensive, I fear :? and that compromizes the grade of "usefulness" (dunno if there is a word like that).

I have been thinking about how useful those functions actually would be. I mean - you have made the map, so of course you know where the AI can build and where it can't. And about the terrain height and grass for slowing down units - I belive it's already hardcoded that the units pick the route that will bring the from A to B in the shortest amount of time (and that isn't necessarily the shortest way :P ). Grasshight for cover is the only really useful possibility, you mentioned, I can think of.
But if you go really advanced (and I mean VERY advanced), they could form a basis for an overall AI useable on any map :!:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 04, 2009 11:58 pm 
Offline
Moderator
Moderator
User avatar

Joined: Fri Jan 13, 2006 6:20 pm
Posts: 2325
Location: Argentina
McBenn wrote:
gwren1 wrote:
Maybe GetTrampledGrass(x,y)=Boolean ?
But if you go really advanced (and I mean VERY advanced), they could form a basis for an overall AI useable on any map :!:


That is the Long-Range objective of the MicroAI functions that I'm developing with your help and the community's.

_________________
-Aleph.

THE Very active person

"You can only do well at something if you put the time in. Doesn't matter what subject it is. You can't make a master piece over night."
Wise man Stu-


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 05, 2009 9:07 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Mar 17, 2008 6:03 pm
Posts: 1130
Location: Denmark
Ahh :wink: so we are getting ambitious now :) Very good. You can always use people who are willing to try. And just the thought of such an AI, if we should succeed, is absolutely fantastic :D


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 06, 2009 12:04 am 
Offline
Soldier level 4
Soldier level 4
User avatar

Joined: Sat Oct 20, 2007 3:51 pm
Posts: 325
Location: Belgium
What about:
Code:
GetTrampledGrass(x,y,z)


z=0(Trampled),1(Low),2(Med),3(High)

_________________
"Life Is Short" ~ Unknown
"All teames hold position, I need a drink" ~ Gagei


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 06, 2009 12:27 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Mar 17, 2008 6:03 pm
Posts: 1130
Location: Denmark
Yeah something like that :P but maybe better if the function returns 0(Trampled),1(Low),2(Med) or 3(High) in addition to the height of the grass. In a list for example: [grass hight, degree of trampled]. Makes it less troublesome to use :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 07, 2009 12:02 am 
Offline
Moderator
Moderator
User avatar

Joined: Fri Jan 13, 2006 6:20 pm
Posts: 2325
Location: Argentina
I'm not sure if there are logical levels for trampled grass... But its not the same if a tank passes by than if a human or a light vehicle does. Anyways, I suggest Stu checks out this and see what is best. Still, we all know any of these are a MUST. :)

_________________
-Aleph.

THE Very active person

"You can only do well at something if you put the time in. Doesn't matter what subject it is. You can't make a master piece over night."
Wise man Stu-


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 07, 2009 1:54 am 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 5015
Location: UK, Scotland
Nothing in this thread from what i can see is needed.

Quote:
TerrainType(x,y)=Type

Where type can be: earth, needles, don't enter, don't enter water, water, don't enter rock, rock, swamp, snee, road, bank.

Its important because it can tell lots of things: if the unit will be slowered down while crossing, if its a good or bad place to build something, etc.


Useless as writing pathfinding code is pointless, the game already has that. It also won't help determine what is a good build spot (Like the rest of the suggestions). You can't make an AI that can work out the perfect build spots reletive to there position. NO RTS game does that. They just build a circular/square base and continue going outwards as much as they can (Within some limits).

Quote:
HexHeight(x,y)=Height

Where height is the actual height of the specified hex.

Its important because it can help with the following: checking if the position is good for building defenses, if the position is optimum for a recon to go (level of the field of view), etc.


Nope, it won't help with either of that. Just because a place is high doesn't mean its a good recon spot. For stuff like that you would need to do it per map and tell the code where are good spots because you can't work it out just by hex height.

Quote:
GrassHeight(x,y)=Height

Where height is the actual height of the grass on the specified hex.

It is important since it would be very useful for checking some of these things: If a unit will be slowered down when crossing it, if it will have good or no cover at all, etc.


I don't belive that units are slower when the grass is high. I also don't think grass height effects view distances like trees do.

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 07, 2009 9:12 am 
Offline
Original-War.Net Owner
Original-War.Net Owner
User avatar

Joined: Wed Jan 25, 2006 10:21 am
Posts: 2786
Location: Poland, Białystok
stucuk wrote:
I don't belive that units are slower when the grass is high. I also don't think grass height effects view distances like trees do.

Yup, no difference.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 10, 2009 12:03 am 
Offline
Moderator
Moderator
User avatar

Joined: Fri Jan 13, 2006 6:20 pm
Posts: 2325
Location: Argentina
0warfighter0 wrote:
What about:
Code:
GetTrampledGrass(x,y,z)


z=0(Trampled),1(Low),2(Med),3(High)


I was examinating the Inter. Configs. Dialog in the editor for advanced use... I made this discovery:

Image

So if created, it should be:

Code:
GetTrampledGrass(x,y,z)

z=1(Very low) ; 2(Low) ; 3(Low-Moderate) ; 4(Moderate) ; 5(Moderate-High) ; 6(High) ; 7(Very High).

And I think that since lists are possible, everything can be included in only 1 function:

Code:
TerrainOnHex(x,y)=[type,height,grass,grass_height,grass_trampled,grass_trampled_state]

_________________
-Aleph.

THE Very active person

"You can only do well at something if you put the time in. Doesn't matter what subject it is. You can't make a master piece over night."
Wise man Stu-


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 10, 2009 11:26 am 
Offline
OW Support Owner
OW Support Owner
User avatar

Joined: Wed Dec 28, 2005 11:13 pm
Posts: 5015
Location: UK, Scotland
You might want to take note of Stucuk's post.

_________________
Image
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 10, 2009 4:13 pm 
Offline
Moderator
Moderator
User avatar

Joined: Fri Jan 13, 2006 6:20 pm
Posts: 2325
Location: Argentina
stucuk wrote:
You can't make an AI that can work out the perfect build spots reletive to there position. NO RTS game does that. They just build a circular/square base and continue going outwards as much as they can (Within some limits).


:twisted: YES I CAAAAN!!!!

No, seriously, other RTSes might not provide this info... But you have a point here, and there is the "ValidHex" function which returns if the section is bordering, if its valid or invalid, so probably using it its possible for this case, non-valid hexes will be removed from the radius, etc.
I've readed the game's rules, and I can assure you that a unit does get slowed down with grass, it has no pathfinding with that thing, but still the difference is only a little compared to normal terrain, so you might not like to consider that (tough little details make the whole more perfect), and I think its important for CoveringAI, since a unit gets IMPORTANT COVER when the grass is tall enough... Still, we can go through the pain of creating (as I have written before) areas for each thing instead of using a proper function, with every map... ... Which in my opinion it dosen't help with the time we have to mod. Having these functions will indeed save A LOT OF TIME, with things that don't only regard pathfinding, but to other things as well.
In the Flags map, for instance, an AI which uses good reasoning won't send its soldiers on foot to get through the waters in the middle bottom sector if there is an enemy there, and a way to check it quickly is to have a function that gets information about the next hexes, based in the units' trajectory... Oh yeah, no game uses that... But its useful! :roll:
About the recon thing, we can check if the tall hexes have enemy units nearby, its not that hard, a recon is like a fast spy, it goes nearby, but instead of hacking something, it gathers information...
The idea of adaptable AI is also to don't have to create 100000 areas in every map. Give it a try. :wink:

_________________
-Aleph.

THE Very active person

"You can only do well at something if you put the time in. Doesn't matter what subject it is. You can't make a master piece over night."
Wise man Stu-


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 10, 2009 6:37 pm 
Offline
Soldier level 4
Soldier level 4
User avatar

Joined: Sat Oct 20, 2007 3:51 pm
Posts: 325
Location: Belgium
And the trampled grass function would also be handy to know if there was enemy movement.
(Although it'd need to know it didn't trample the grass itself.)

_________________
"Life Is Short" ~ Unknown
"All teames hold position, I need a drink" ~ Gagei


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Original War is an RTS / RPG game by Altar Games
Original War Support is not part of Altar Games but is maintaining Original War for Altar Games

Privacy Policy