artificial intelligence - Softcoding AI in games -


i in process of developing game, similar in concept risk or monopoly (a board game, essentially, although asking can extrapolated). such, , assuming want computer opponents, need write ai.

now, question whether need program ai directly in program (hardcoding) or if there exists way program wrote read list of directions , behavioral rules, softcoding ai.

i assume if softcode described before, need program possible actions ai use. assume can't tell softmoded ai anything, unless programmed (for instance, decision-making actions depend on multiple factors). overhaul (advantages/disadvantages) in softcoding opposed hardcoding specific ai?

some ai techniques cpu intensive, such heuristic based breadth first or depth first search lends many strategy games.

a search require establish api such current 'state' (a complete representation of state of game) retrieved, , list of possible moves/changes state (or state), , new state each of moves/changes lead to.

once have done possible algorithm make appropriate api calls see states can moved to, , states can moved states, etc. states can reached grow exponentially more moves try ahead such 2 moves might horrendous task computer.

because of difficulty, heuristic scores used evaluate usefulness of following branches, search algorithm might discard 90% of first possible moves current state immediately.

an ai follows pattern of getting states, evaluating them , looking @ possible moves/changes state subsequent states, soft code ai, ai in order heuristically score state , soft code mini language. personally, unless giggles want implement mini language, quite hard work way things. also, soft code require sort of interpretation, might make twice slow code, or 10 or 100 times slower... , exponentially difficult techniques mean performance very important. if ai method chosen not exponentially difficult, or plain difficult, soft code used, still you'd have implement mini language.

you of course implement ai separate program communicates on network game program. might localhost localhost, of course need not be. performance of degree depend on network latency , bandwidth, may or may not significant problem.

you implement ais dynamically loadable libraries (i.e. game might in folder, see bunch of lib files , try load them @ run time (e.g. dlopen() unix). drop new ais in @ time without touching game itself. if main requirements have plugin ais , maintain performance performance matters, might way go.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -