Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Sep 1999
Offline Last Active Nov 23 2015 06:33 AM

Posts I've Made

In Topic: Help on Game AI Design

23 September 2013 - 11:56 AM

Hey again.


So, I've got the first version of the AI working. Cant tell if it's good yet, would have to play against them a few matches, but its working (as in "not crashing"), and seems to be (way) better than the last AI version.


Just as a recap, I had planned originally to decide and save a "goal", to then match the goal to a task, then create 3 tasks of each goal type, and then compare the task scores. I ended up not doing that, and what I will do now is simply create a single task of each type and assign a score to it. Then I pick one of the top tasks randomly based on the score.


Seems to be working fairly well, but I have to play and tweak the constants used on the formulas. But I think that for now it's fairly usable/testable.


What about the scripting part: does anyone have experience on that? That way it would be easier to allow other people (other programmers or even players) to help me on the AI.


Best and thanks again.

In Topic: Help on Game AI Design

23 September 2013 - 04:51 AM

Hey guys, thanks a lot for the replies!!


@foxcode : initially I wanted to go along the lines you described, but I didnt know the name or how to do it. I like the idea of "training" the AI, so I could leave the AI playing against itself for a few days, save all the training data and then load it on game start. I might try to go this way on the next implementation (which Im feeling will be needed before release), I just have to read a bit about it before trying, but knowing it's name solves half of the problem already :)


@BensBucketGames : yeah I love the challenge of it also, the problem is that Im short on time... I wish I had a couple extra weeks to work on it. But anyway, after releasing I can continue to work on the AI and improve it, so Im not so worried, as for the beginner player the opponents are not very much relevant (if they end up too smart, I will have to dumb them down). But I love the idea of having different personalities, that way I can mix different AI personalities on the same match so the AIs dont look and act exactly the same, providing a wider range of outputs for the gameplay.


@ActiveUnique : you have touched 2 very important points. 1) Yes, it is overcomplicated. While implementing it on Thursday/Friday I noticed it is way too complicated, and also it didnt work very well (I will make a new post about it when I actually finish or abandon that approach). 2) For most players (beginners) the challenge and fun is the game itself, and they will mostly ignore the opponents, so the AI isn't very important for those players.


Well, I will go back to the AI now and hopefully in a few hours I will have it finished. Hopefully I won't have to throw it away :) . But certainly I will have to restart it from scratch sometime soon.


Thanks again, and I will post an update here later.

In Topic: Help on Game AI Design

19 September 2013 - 12:22 PM

Hey all.


I had to do some other tasks yesterday and this morning (had to update my already existing game), but now Im finished so Im back to BBTV's AI.


So, yesterday I completed/rewrote the AI's API, that is, the exported game functions that the AI can call. Then I started making the AI itself (started fresh), and this below is what I came up and am doing. Please advise if you see a better path :) .


The AI is composed of a simple infinite loop:


- decide next task

- do task until finished or aborted


The task is an instance of a simple class that has the task type (walk to certain place, idle, buy certain movie tape, etc) and parameters (which movie tape to buy, where to walk, etc).


The 2nd part of the loop ("do task") is the simpler part, as there's no intelligence involved. It's a simple method that using the game API sends some commands when needed to make the computer's avatar do whatever it was commanded to do. For example, on the "buy movie" task, it checks whether the avatar is on the movie shop, and if not it commands the avatar to move to that destination. When it gets there, it sends the command "buy movie" to the API and then finishes the command and go back to the loop.


The 1st part ("decide next task") is the actual AI part and is what Im starting now. This is what I planned:


1) I created a "Strategy" class that controls the player current needs. Its basically a pack of indicators that value from 0 to 10 that tells how important is that factor right now based on the match context. For example, "money" is one of these indicators: if the player is low on cash (or even worse, negative), this indicator will be very high. Being very high, the idea is that on the array of possible actions, the action that solves this short term need will be highest ranked and selected. In an extreme case (say, the player has negative cash, so the score is 10) the action might be sell out some of his assets (tapes, antennas) to "survive".


2) Initially I need to actually calculate these strategy indicators, so this is where I call the game API to get lots of context information about the match. For example, the indicator "movie tapes need" can be high when the player has only a few tapes, or the competitor tapes are better, or he's not doing well on audience... 


3) Then I simulate all the possible actions. To do that I have pre-defined weights for each action type against each strategy indicators. Also I will need a second factor to weight in: I need to estimate how applicable is the exact action right now (given the game context). This factor I think it can be a percent: so if that action can be perfectly executed right now, then I give it a 100%. If it wont give any result at all, I give it a 0%, etc. To illustrate: when the player is low on cash, certainly one action that would be highly ranked is "Ask for a loan". But that action isnt always available, for example if you already have a loan, you cant take another (so "Ask Loan" would give no result in this case).


4) Then I simply set the next action as this that was just created.



The biggest problem is of course Step 3, given the potentially infinite number of possible actions. Before simulating individual actions I think I will rank the action types and select the top 3 action types (ex: buy movie, buy antenna, buy news). Then for each of these 3 action types I use some reasoning (no idea how yet) to simulate maybe 3 specific actions that I think that will succeed (buy movie A, buy mobie B, buy movie C, buy antenna size 2 on area 1, buy antenna size 1 on area 3, ... ). Then I generate the 9 actions, add a little random element to its score, rank it based on the score and select the best.


Well, I think it will be hard to finish this today, but hopefully tomorrow it will be ready.


Any inputs? Ideas? Problems? Optimizations?



In Topic: List of free ways to make games

11 September 2013 - 03:35 PM

Sites that have free icons/graphics for your games: www.iconfinder.com , www.iconarchive.com

Some specifically for audio: www.freesound.org , www.therecordist.com/free-sfx , www.partnersinrhyme.com/pirsounds/WEB_DESIGN_SOUNDS_WAV/SOUNDFX.shtml

One that have both audio and graphics: www.opengameart.org

In Topic: Indie Games Section - In Progress

06 September 2013 - 11:53 AM

Yep, projects can be created until it's officially out there.   I just started teaching again this past week so things have been a bit hectic but I got a few more things tweaked today based on submitted projects.

I've started testing the Indie corner, seems good so far... but where to submit feedback of the Indie corner?
I will put here while I dont know the correct place so I dont lose the copy/paste smile.png . Feel free to delete the message (or edit) after reading.
After creating the project, I selected the Developer Journal tab and wrote something as a test. It worked (it seems), but it gave me an error message:
Warning: Data missing in classes_like_composite::add in /var/www/gamedev/admin/sources/classes/like/composite.php on line 546 Warning: Relationship ID missing in classes_like_registry::getKey in /var/www/gamedev/admin/sources/classes/like/composite.php on line 143[/size]
EDIT: In fact I just realized I had written a Comment, not a Dev Journal entry. It was not clear, I thought it was a developer journal entry, but in fact it was the comment box that always appear at the bottom of the screen (since Dev Journal was empty the Comment box was on top)
I put a couple Youtube links as Additional Videos but I cant see them on the project page.
The "Edit" button is kinda hidden and it seems that it relates to the Comments section below, and not the project info itself. Took me a while to find where to edit.
Since the videos wouldn't show, I put the links to the videos on the About part, and it nicely expanded to an embedded video when viewing the project. The problem is that when I edit, it doesn't convert back to the URL of the video (it shows the embedded video on the edit panel), so when I save the edit the video link is then lost.

I didnt find a way to edit the Help Wanted section. So I'm assuming its not implemented yet.