Jump to content
Sign in to follow this  
Rydygier

ArmaChess - need a little brainstorm here about "sectorize" concept

Recommended Posts

During recent practice coding created some interesting in my opinion function, that allows to split a given square area (with any angle) to the selected number of square sub-sectors. Returned is nested array of locations, each for one sub-square and one separate for main location, that covers whole area. So, I'm thinking now, for what purpose this may prove useful? Any ideas? For now I had two/three:

1. In fact not my idea - heard about something like that somewhere. This may be very handy for some AI scripting (eg for my Hetman, but also on lower level) - if to cover whole map with such created square locations, there will be possible to bound by setVariable many data with each sector - topographical, tactical, other... By using this sectors AI can now to decide, which path will be optimal for movement, what send where, where to go, and which areas should be avoided, to analyze enemy presence per sector, can recognize and refer to certain areas... In one word to process bounded with sectors data in many ways, in many situations;

2. To make Arma (quasi)turn-based board game using map only, where real groups will become pieces, or only with markers - and here we have an practical example: crude, but playable chess on Utes map. You can choose piece by single click on it, next click will make this piece to move at closest square. For remove piece from chessboard - move it same way at one of circle markers. Script will not check correctness of the moves - any movement possible, all in the players' hands. Only HotSeat mode available, I'm afraid :). Chess AI is somewhere far beyond my skills. As pieces are used tactical markers... This of course can be applied to any map, also as hidden in action menu option, and used when there is nothing better to do, only boring & waiting, for example during the night watch...

3. Can be maded some kind of cellular automaton, as "Langton's Ant" from my avatar, but - what for?

Edited by Rydygier

Share this post


Link to post
Share on other sites
By using this sectors AI can now to decide, which path will be optimal for movement, what send where, where to go, and which areas should be avoided, to analyze enemy presence per sector, can recognize and refer to certain areas... In one word to process bounded with sectors data in many ways, in many situations;

Smart Maps!!? I always wish that AI could understand that they are in an open field when danger is close and they should maybe not be there.

This may be very handy for some AI scripting (eg for my Hetman, but also on lower level)

another very interesting project from you :)

As usual i get these things when im at work, chess on utes sounds interesting, try it out later... thanks

Share this post


Link to post
Share on other sites

Sounds pretty cool! Looking forward to you using it in Hetman! :)

Some ideas from a non-coder's mind, just quickly firing them off without too much knowledge how much is possible or permittible by the engine:

* AI commander "visualising" frontline by "heatmap" of spotted enemy concentration per sector, draw line, act upon it (pinch,flank,...)

* AI commanded squads using cover by terrain - keep in treeline when moving from A to B even if that means a detour, keep on outskirts of village (and then use builtin microAI "take cover" or UPSMON like) if guarding a sector

* AI commander/squad leader using Defilade (Reverse Slope) tactics when guarding a position (calculate terrain height difference, find crest of hill wrt direction of enemy advance) instead of them lying prone on the downward slope presenting easy targets

* Vehicles and terrain - improve upon high-scale vehicle pathfinding - say a "heatmap" of sectors with too much slope is computed, never place vehicle waypoints inside of this (although the micro AI would probably override this), instead take a detour

* Aircraft pathfinding on higher scale - sectors known with AA presence, avoid them. Fly under the radar - take a detour through valleys (by auto placing waypoints) until near target - a "heatmap" of sectors into map of routes through valleys for example.

* cellular automaton - zombies! (kidding) ;-)

looking forward to try out the Utes Chess ASAP

Share this post


Link to post
Share on other sites

Thanks for ideas, really very interesting. About Hetman - some major changes/additions still awaits for my attention, some listed in the HAC's thread, one of biggest will be rewritting code according to new possesed scripitng knowledge to make it less messy, not so redundant (eg lately familiarized with functions enough to use it wider) and easier for furter maintaining. Also currently working on brand new field of view scanner, part of another project, that consideres also objects, not only terrain, and terrain should be considered better, with more complex manner - this also may be used in HAC, unless prove too heavy) - this rewritting may and probably will be a lot of work... Still awaits, because decided to use old, good blitzkrieg tactics in scripting - when encountered some harder challenge - do not sturm frontally, rather try to outflank by dealing meanwhile with secondary tasks, enhance knowledge and skill in side, but relevant matters, attack rear and sturm main problem only when will be completely surrounded by knowledge, weakened enough and cut off. :)

All this of course as long, as real-life matters (work) allow me.

Edited by Rydygier

Share this post


Link to post
Share on other sites

* AI commanded squads using cover by terrain - keep in treeline when moving from A to B even if that means a detour, keep on outskirts of village (and then use builtin microAI "take cover" or UPSMON like) if guarding a sector

Check out the AI "Find Cover" module of SLX - the AI does precisely that. Instead of moving from waypoint to waypoint in a straight line across open ground, they detour to stay in cover, or at least concealment. It doesn't seem to change the waypoints themselves, just the route between them do it doesn't break missions unlike, say, GL4 often does. Solus was one mighty coder!

Share this post


Link to post
Share on other sites

Totally count me in, we gotta talk!

Sadly not bringing any scripting knowledge to the table, but the ground concepts for an interesting ArmA Chess mode, and other fun features is all laid out in my brain0.

Wanting to do this since a few years already, absolutely overdue. ArmA needs battlechess, now! :thumb_down:

Share this post


Link to post
Share on other sites
ArmA needs battlechess, now!

FPDR :smileee:

How many times did I hear that in the last year :D

Xeno

Share this post


Link to post
Share on other sites
FPDR :smileee:

How many times did I hear that in the last year :D

Xeno

If i got a dollar for each time you let me down on this i probably had about 4567 quid by now :)

Share this post


Link to post
Share on other sites

So maybe just describe yours ideas, Mr Burns, and we will see, what should and what can be done. :)

Share this post


Link to post
Share on other sites

Ok here is my chess idea. The map is split into 64 sections (8x8 grid). Each piece on to board has a certain number of arma2 units (pawn is 4 inf units, queen is 3xMBT for instance). The AI decides to attack another grid. At this point they can ONLY be harmed by the other grid. The two grids fight and when no units remain the other unit then moves and occupies the newly won grid. As with chess units can only move in their standard fashion. You can only attack the square that you are able to 'take' in normal chess parlance.

If you fight a piece and win you get back to your pieces full strength.

So the map is in constant battle around you, but You can only be killed by the piece attacking you.

Does that make sense?

Share this post


Link to post
Share on other sites

Probably does with some corrections. :) Main problems to think of here seems to be: to make all enemies ignore each other except currently attacking and attacked - otherwise nearby enemies will all the time shoot at spotted opponent; also implementing AI for movements.

Share this post


Link to post
Share on other sites

Basic idea for A solution to those problems:

probably need a global variable... movecomplete for example.... set to false initially

set up all units

setcaptive true to all

do the external script checks for the chess style moves

when it is confirmed it is a valid chess move, setcaptive false to the moving element and any element in the target location

set waypoint for moving unit to the middle of the target location (which would be where the defending unit is)

two seperate triggers created via script covering target location - bluefor not present and opfor not present (issue: maybe only active when moving element is there?)

both triggers set movecomplete to true ie. if one isnt present, either there was no enemy or one side unit has been destroyed?

issue: delay until moving unit is present so move isnt finished before the moving unit gets there!

when movecomplete is true, do the post move stuff... something like setDamage 0, fuel 1, ammo 1 etc ... (ie. reset to full strength unit? although I do think that attrition could be another consideration? maybe have difficulty levels : easy means units are replenished, hard means they arent?)

Achievable by detecting all in the trigger area and doing the setdamage/fuel/ammo commands 'forEach this list'

Final part is setcaptive true forEach in the moved to area...

repeat until kingunitblue OR kingunitred !alive

?

Hopefully that conveys a basic idea?

Maybe not the most elegant solution but one to build from possibly... Hopefully someone smarter can elaborate - I DO like the idea of force on force chess!

---------- Post added at 02:37 AM ---------- Previous post was at 02:30 AM ----------

Hot seat/ MP would be easiest to implement initially... but for 1 player:

https://www.google.com.au/search?aq=1&oq=chess+ai&sugexp=chrome,mod=2&sourceid=chrome&ie=UTF-8&q=chess+ai+algorithm

Share this post


Link to post
Share on other sites

Hi Rydygier,

I´m very happy you are thinkink about some kind of chess in ArmA.

I knew you make some of us (Mr Burns to name him) very, very happy.

Sadly i can´t script, but when you need some modelling work i can give you a hand.

OT: I remember a very old amiga game, you played chess with dinosaur. When one beat another they had to fight like in Street Fighter :yay:

Absolut awesome! Maybe in ArmA a Duell in slow motion with a big Handicap for the Defender? :p

Share this post


Link to post
Share on other sites

I did not suspect that there is so intense demand for such a niche ideas :) , if so, then I'm glad, that I may to try to do it not only for my own scripting practice and satisfaction, but also for someone, what always makes me more happy. Thanks for ideas and solutions, Zodd, this project is on my "to do" list, however, there are also some other ideas higher on that list, so this will not be maded "immediatelly".

Share this post


Link to post
Share on other sites

@zodd: same idea on my part. Set captive and allowdamage false for each unit located in a "non-playing" square.

After that, maybe you could go for something like, when you get to the other side of the board, you get to call an airstrike once, or something like that.

Share this post


Link to post
Share on other sites

Here is very, very wip demo. Probably "a bag of bugs", but if someone still interested, can see, how this may look in the future. Of course many things can be changed.

ArmaChess 0.03

This is "passive hotseat" variant. Means, that this is hotseat, where players only move pieces on map (there is no auto-check, if someone tries to move twice for now), but aren't involved in firefights directly. Battles and movements are shown via kind of dynamic camera. In the future possible some AI opponent, but probably will be not too smart (means - idiot, that knows rules and main goal). Also probably this can be adapted for MP, but I can't do this. Maybe someone else will.

Many bugs should be expected, for example fight (scripted, because of some de-captive bug with not engaging targets) is not properly tuned yet for vehicles. There is lack of regeneration after fight for the winning piece. Movements aren't and will be not simulatanous, only one fight/move at once is possible (unit cannot be selectively "blinded". Will shoot to all spotted non-captives, or to none). There is not and most probably will not to be chess' "Castle" move and "en Passant" capture. For know there is not any bonus for pawn on "queening square". Rest moving and capturing rules should be on place.

Still important is, that main, "core" code of ArmaChess playing is roughly done.

Usage: LMB click on chosen piece (then should be highlighted available for move squares), then another LMB on target square. Illegal move will reset piece choose, so all procedure must be repeated in such case.

Edited by Rydygier
0.03 - fix

Share this post


Link to post
Share on other sites

Great Concept! I had a Round and it worked very well for 5-6 moves, than the tower (Tusk) had some trouble with his waypoint/move and stopped.

I´m sure this can be handled with some scripting.

The Camera movement is awesome! Please don´t remove it. I´m very curious what comes out of this! Now i search for mr Burns :yay:

Edit: Had another round with myself :cool:

This time i was able to play a long time. Bugs i found:

-One time the cobra flew a few meters above the square and it got one square behind, the false field got accepted and i moved on from there.

-units don´t allways attack. May be mainly with no AT-Units against Tanks.

-One time i thought the defender units got deleted after a while, when still alive. Another time they watched each other and nothing happens.

This is no criticism, only some feedback!

Do you have an idea which way you will go with your work? I mean, playing the traditional chess with some graphical Eyecandy, or some kind of "Arcade Chess".

Edited by Baraka

Share this post


Link to post
Share on other sites

Thanks for feedback, very appreciated. Air units are hard to move properly, as these have big "completion radius", will struggle with that for sure. Attacks are scripted, but script currently is launched only for inf vs inf fights, as vehicles act strange under this script, another issue to solve. For now, when vehicle is involved, only both groups are "revealed" to each other with max value, but still may occur known bug, when captive, that is de-captived refuses to attack enemy, that was known to him before de-captiving. I'm not sure yet, what to do with that.

Deleted unit - is not a bug. Fight is over also in the case, when one "piece" starts to flee. Then is just removed. Of course fleeing can be turned off via script, maybe will do that.

I think, that this cannot be simply traditional chess with unusual visualisation. Rather "arcade" with movements stricted by chess basic rules. For example there is not sure, which piece win the fight, that is against chess' rules, where attacker always win, also goal here is to kill enemy king, not checkmate (and is possible leaving own king under check, and move somewhere else. Stupid, but possible). Also there is no mentioned earlier rules...

Edited by Rydygier

Share this post


Link to post
Share on other sites

Last wip:

ArmaChess 0.04

after some fixes and improvements, but still possible serious problems, as getting stuck during fight. It may take some time before next version will be ready. Any feedback or ideas till then very appreciated.

Share this post


Link to post
Share on other sites

Hi Rydygier.

The GUI-improvements are really good. Especially that one side can´t move 2 times anymore.

The gameplay itself feels very buggy atm. Your system works very well, but as soon the ArmA AI got some action it turns out to a mess.

Had a situation where 3 Vehicles where on one square without attacking each other. Also the Infantry won´t attack mostly.

Maybe there is so much trouble with the mixed unit style. The Infantry pawn for example have one AT and one AA shot. When it won´t hit they are helpless.

An Idea: This kind of Battlechess may feel better with more balanced Units. It would avoid a lot from your current trouble. Infantry should be forced to walk faster via

setUnitPos "UP"
and
setBehaviour "CARELESS"
.

Another Idea: RINCEWINDER Magick System + Chess = Epic

Share this post


Link to post
Share on other sites

Yes, as predicted, main problem is strict control over AI. Generally it is very hard in Arma to force AI to do exactly, reliable and each time what is needed. Many work ahead in this matter, and success isn't guaranteed. For now pieces aren't good balanced at all, current set is rather temporary. Perhaps easier will be, when every piece would be just a single vehicle of some sort. Air units are big troublemakers too. For example was forced to use "dirty" setPos method for set up choppers at square center, because of its too big completion radius... setUnitPos, setBehaviour are in use currently, amongst the other commands of that type.

Another Idea: RINCEWINDER Magick System + Chess = Epic

:) Thought about that. Needed only some BM's AI script adaptation, such version probably will be made. This of course is available only for infantry. BTW - in fact defining kind of pieces is easy here, so perhaps there will be kind of userconfig for customizing that.

Share this post


Link to post
Share on other sites

Haha, glad you like the idea. Your RINCEWINDER was my first thought when i saw the first Chess version ;)

Imagine a mystic Level design with some fog and crows , an old decomposed place with an giant stone chessboard on the ground.

The best Battlemages in the world meet again,struggle for mastery in their immortal tournament :yay:

Share this post


Link to post
Share on other sites

Yeah. :) Such dedicated to ArmaChess mini-map would be great, but this is beyond my skills. For now - more prosaic work, means next wip:

ArmaChess 0.05

Some problems still persist, but is better and there are new things:

- replaced pieces. Now each piece is a single vehicle. Not quite balanced yet, but is rather no bad;

- now needed addon (included) that gives set of real, classic, chess symbols instead of military markings;

- some minor improvements including few sounds (based on "Board Creak" by Mike Koenig from soundbible.com - Attribution 3.0 license);

- chessboard is smaller for avoiding "red"/"black" pieces behind pipeline barrier (this means also quicker movements and more rapid firefights);

- refuel, reammo and repair for winning vehicle (dead crew not replaced yet, but this should be very rarely needed);

- some script for intensification vehicle duels...

Share this post


Link to post
Share on other sites

Next:

ArmaChess 0.06

- few fixes made;

- first "AI" version.

About AI - it is very stupid for now, can be activated and deactivated for one or both sides via action menu, accessible between moves, when map is turned off. If activated, AI will start when map become active again. So when AI for both sides is on, there is only short period of time to change that between movements. Not fully tested for switching in "strange moments".

"AI" is currently primitive, checks every piece, if it can attack enemy King, if such piece is found, is chosen and will attack, if not, AI chceks for all pieces, that can attack anything. If found such pieces, one of them is chosen randomly, same as its target, if more than one enemy pieces can be attacked by chosen piece. If not found, then AI just check, who can move anywhere, and will choose piece and its target square randomly.

In the future, I hope, all this pure randomness should be replaced with some more "wise" decisions...

PS still possible getting stuck during duel. This is very persisitent problem here.

Edited by Rydygier

Share this post


Link to post
Share on other sites

This one is promising, because after further fixes got AI vs AI long gameplay without any problem. Then stuck, because both fighting pieces was stopped and do not fire. I think, that repaired this issue, not tested yet however:

ArmaChess 0.07

Next:

ArmaChess 0.08

- more complex AI (tendency to capture center of the chessboard and/or push towards enemy King; may need further balancing);

- "anti-stuck" code improvements.

Next:

ArmaChess 0.09

- improved AI for better protection of own King;

- even more "anti-stuck" fixes.

Edited by Rydygier

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×