#ai-dev
1 messages · Page 3 of 1
lot of Game AI is basically decision trees and behavioral trees which yeah, are just a bunch of if and else statements. You can attempt to train a neural network but the caveat with that is that the more complex your neural networks are the harder it is to debug cause you got no clue what's going on. Basically if someone goes wrong gl figuring out what went wrong hence why decision trees are a lot more common. But if u have the space to train a model that's not a neural network you could go for it
the time to train an actual AI to play a game is immense, especially if it needs to consider many variables. Just look at AlphaStar and starcraft.
In the picture there's a enemy with a overlapBox to check for the player.
When the player is above the 1st platform the enemy will detect it. But when the player is above the 2nd platform the enemy will also detect it when it goes to the right side of the 1st platform during its patrolling, which is a behaviour i do not want.
the enemy is a melee type. and here i said platform but they are actually a tall patches of ground.
You can try using Update to keep moving the overlapBox back to its initial position.
That, or you should write a separate script for the overlapBox and make the box no longer a child of the enemy, then let the script forward trigger messages into the enemy script.
but how would the overlap box know where is the ledge on the right.
the enemy has a ground check near it's feet only when the enemy goes to the corner most right will the enemy itself know it is near the edge, then the overlapbox will know but by then the overlapbox already goes to the other platform
If you already know the enemy's movement range, the position and size of the overlapBox can be fixed
the enemy doesn't have any movement range it is free of it. If i knock it down the platform it will move a different path according to that platform
Ah
are you aware of the game Deadcell
Haven't heard of it before
I don't think you'd want an explicit box here
If both the player and the enemy keeps track of the platform GameObject they're currently on, you can just poll that
they are not exactly platform. i just used that word for simplicity. they are patches of ground so all of them is the same platform(technically)
compare whether they're standing on the same platform, and if their taxicab distance is within your AI's alert range
Unless you use extra markers to label separate surface segments, I don't think this can be done trivially.
explicitly adding trigger boxes for each surface everything can stand on and using that to tell which surface each object is on
The problem lies in that the only reason we know there are five different platform segments there is because of the 90 degree slopes
i have heard about adding platform triggers for enemy movement like adding trigger colliders at the edges of the platform on the ledge position. So when an enemy collider get hit by it it changes direction and so on.
currently i am doing changing direction with using two raycast per enemy object. one for ground and one for wall
is the first option a viable approach for a good game. because per the first option i don't have to cast ray per enemy object and in the world at the same time there's gonna be at least 10 enemy. for a mobile platform 30 raycast per frame isn't it too much?
I would use the first option, yeah. Though regarding performance, I would recommend you to actually run benchmarks (like, try writing some script that uses raycasts and give them to 30 objects)
i see. i will keep that in mind. Thanks for the help
I don’t have the code on me right now but I’m doing a boomer shooter and trying to have the enemies do multiple attacks types based on range and random numbers
If in range attack distance: role random int between (1-10) inclusive: if 1-9, fire gun. If 10, throw AoE grenade. If inside melee range, attempt melee attack.
My thing I’m trying is I don’t want an enemy to instant the attack the moment the player is in range
I think maybe have a “think timer:” a small delay that constantly runs for like every have second that flips a bool on and off, and if on they can do an applicable action that is restricted by the bool (so things like “if dead” are not controlled and override any potential other actions)
Just need to sort the code
You can probably do it with a coroutine containing an infinite loop that yields for a few seconds every loop. You can then evaluate the AI decision after the yield statement.
This should result in the AI making decisions spaced out by a set time interval (like the think timer you're talking about)
Has anyone made a graph neuralnet?
Hypothetically, how would you store a neural network structure and values in a recombinable genome? I'm doing some evolution simulations and I'm trying to implement sexual reproduction
Are the planets having sex now?
Can you just take half from each sets of weights, or just average them?
Any dc bot dev here?

Nah, learning how neural networks work so that I can try and generating creature morphology
Hello! Has anyone tried to integrate GPT-2 into Unity? I´d love to fine tune a model and play around with it, but don´t know where to start...
that seems intense
Hey guys, wanna try to make a learning AI that trys to make game ideas? It will take feedback and transfer that into points to figure out how good it was. There will be 2 modes, personal and community mode. Personal will start with no feedback at all and will be personalized to the user based off feedback. Public uses feedback from everyone who ever used that mode.
There will be 3 options, smile, neutral, and sad. Smile gives the AI a point, implying it did good. Neutral does nothing. Sad negates a point and the AI will change what it did last time to improve.
The AI will try to get as many points as it can, and it will not want to loose points.
If only I was smart enough to make this.
I have been considering trying to see if a bot can develop a fetish.
I might try that
maybe there will be something I want the bot to get a fetish of, and it will have 10 moves. after the 10 moves are used, the simulation is reset.
The bot will have three actions to preform each turn, action 1 is walk left, a2 is walk right, and a3 will be a special action that if preformed correct gains 2 points and if done wronge removes a point.
Once a simulation ends, the game checks if the bot has more points then last time, if not the bot will take the previous successful wiring and change one thing. If the bot has more points then last time then the bot will update its high score and take those saved actions and change one of them.
My goal will be to have this bot have a stronger fetish then the people on deviant art.
(This will be the most stupid ai idea ever.)
Never mind, Im not big brain enough.
Also the idea is stupid anyways.
Anyone have experience architecting AI for an ECS game?
In the past I've split my AI up into an Action provider that queries the world to populate possible Actions. The actions themselves have parameterized delegates that run on the entity in question and I have a separate system to estimate utility and choose which actions to actually do.
But delegates are contrary to the sytems in ECS
and I'm not really sure the best way to componentize action data
you could group all AI into one system
a component would be a list of behaviors/actions/etc
My initial thought is to have a BehaviorComponent for tracking the state which can be used in some AI system when selecting the next action. The current action will just be component data attached to the entity and a component to track which components are being updated as part of the current action.
Then selecting a new action will go through and remove all of those components and add new ones.
the additions/removals wouldn't be particularly efficient
i would make AI its own sub ECS
Well additions and removals should be batched and run at sync points so they won't mess with the vectorization of components but they do create rehashing of indices so that has some overhead.
Can you elaborate on what you mean by implementing the AI as a sub ECS?
To clarify here most of the components would be data used by other systems. Since it's ECS there isn't an action/delegate so much as an implicit action (systems updating certain component data).
An alternative to adding or removing their data would be to have those systems check the action component to see if they should update that data. For example, for pathfinding I have a destination component and if the agent doesn't need to pathfind the destination is set to a BOGUS_VEC2 = new Vector2(float.NaN, float.NaN);
I could do something analgous for other systems i.e. a unit that is mining could have a MiningTarget component with null for the mine and resource type
my concern with that is it seems prone to errors
to stop an action I would need to go through and set every ActionTargetComponent to a default value
So I would need to track those somewhere. I could do that on a component or it could be a static Dictionary<action, ISet<Sysemt.Type>>() where the ISet contains the type of eevery component used by an action
csh basically i mean AI can be its own thing that hooks into the rest, sort of like how physics typically works
I'm trying to learn more about behavior trees by implementing them in a classic 'pursuing enemy' scenario i.e. Nemesis from Resident Evil, but I'm running into a design problem. To elaborate, this enemy should wander around the map in search of the player, and possesses sound and sight (cone) sensors. Now, in the scenario that he sees the player and is out of range, he should initiate a chase until he is in range or the player manages to hide -- at which point the pursuer should search the area for a while before resuming a wider patrol.
My issue is: if the enemy chases and gets in range, he should try to attack again, effectively entering into a loop between chasing and attempting an attack. However, the way I designed the tree in the photo above, the 'Chase' leaf would return SUCCESS, which would propagate to the parent up to the root. I know that I could just tick the tree again to reach the same leaf, but I've read it's more performant to keep a reference to the currently evaluated node and keep executing that sub-tree.
While I've done some research, I'm really new to this and I realize that my initial premise might be flawed. I'm going to be implementing this in Unity but I don't want to use an asset, as this is for learning purposes.
behavior trees are kind of an old school design
in my system i have behaviors that are selected based on weights/senses
locomotion (movement) is also separate from other actions
(though the other actions can trigger movement changes)
behaviors run a set of tasks/actions
Does anyone know where I can find more information on how the Sims AI works? Like a picture representation or scripts from the games? Just curious about it.
i doubt it
best bet would be gdc talks
but if you cant find anything there they probably havent published anything
you could play around with the skyrim creation kit and look at their AI scheduling system
its probably not that different
@patent blade Thanks for the recommendations. I've found out a bit about it by researching a recreation of Sims AI in Unity, but I will look at Skyrim's systems as well.
ChrisOfChaos thanked CobaltHex
iirc there was a GDC talk on YT exactly on Sims AI
Basically, every peace of furniture knows what needs it can fulfill and how effectively and creates an aura around itself which tells characters all of that. Then each character looks at how important each need is currently and at how efficiently they can fulfill it (based on furniture efficiency and distance). Based on that, they choose which need to fulfill. While the way to fulfill it is presented to them by the corresponding aura
I.e. when a character starts to fulfill a need, it is the corresponding peace of furniture that takes control over the character. While the character doesn't know how to use any furniture
Yeah, I remember that Sims uses this 'smart object' method, John777.
@dire remnant There's this talk that is partially on AI in The Sims Medieval. It has different requirements so may differ from The Sims vanilla, but perhaps it will give the insights you seek. https://www.gdcvault.com/play/1014569/AI-Development-Postmortems-Inside-DARKSPORE
Ah, the video I actually watched about Sims Medieval AI is this one https://youtu.be/__5whYgSTV0?t=1154 (it's the part at the linked timecode). It tells about a specific bug in Medieval UI but gives some background on general Sims AI.
@quasi dirge @golden needle Thanks.
ChrisOfChaos thanked Manuel, John777
So I'm working on a state machine so I can make enemies with AI for my FPS. But I'm thinking about how much I need to make things modular. My original plan was to have a generic 'AI' or 'Combatant' class where the developer can swap in any combination of states and conditions, which might be better for modularity and potentially allowing designers to implement AI behaviours themselves.
But on the other hand that might be unnecessarily complicated (plus probably requiring coding a GUI) and it may be better to just have different inherited classes for each enemy type (albeit re-using functions and states, obviously).
I imagine the former would be better for a large studio, and it would be good for me to learn how the pros do it, but on the other hand I'm just working on this myself and if I did it the simpler but less modular way it would actually be done faster and I'd have nice AI in my portfolio/game with less man hours.
If you are working alone, why do you need that level of modularity? And what designers are talking about?
Also I am not sure if AI behaviors are handled by designers (who cannot code) even in larger studios.
first question would be to ensure I'm learning sensible practices. But I was also wondering about the last thing you mentioned, which is why I asked
it's possible that even in professional studios they don't worry about that sort of thing
but I don't know because I don't have that experience yet
Is your goal a coding exercise or AI developing exercise?
I want to make functioning AI, but at the same time I don't want to ingrain dumb methods that make me harder for people to work with in future. So if me doing the easier method isn't going to cause that kind of problem, then I'll just go with that.
It seems very ambitions to assume that your FPS AI is going to be used by other people
When I said working with people in the future, what I really meant was 'if I get hired by a studio and have to collaborate with other people on projects', so I want to ensure I don't bring over bad habits I unwillingly picked up
AI behaviors can be handled by designers in some studios. And in order to do so, they'll likely need some good tooling.
However if you're working alone, I wouldn't advise going out of your way to develop tools that won't save you time. Overengineering and over generalizing is a time sink that is often good to avoid, even in professional environments.
but if you want to include these AI tools in your portfolio, that's not a bad idea
yeah overengineering is definitely a thing to worry about, which is why I'm asking
and this was the other reason why I thought to ask (that and simply learning the skills)
I'm leaning towards the easier option, since even in a studio environment the designers would be able to dictate the specific behaviours they wanted so the programmers could implement them, without having to get their own hands dirty
From an AI designing pov, both ways are the same. So you should go with a more difficult one only if you want to show more coding skills
There's a lot of experimentation and tuning when it comes to AI behavior. It's not likely designers would be able to completely define what they'd want the AI to do, let alone get it right during the initial design phase. It's real useful to have designers be able to take ownership of behavior.
otherwise programmers will be constantly badgered by designers to tweak the AI
developing an actual designer focused AI system can be a daunting task. It might also be difficult to do well without feedback from end users. It's not a bad exercise, though maybe try to estimate how long it would take to implement before embarking.
Okay I think I have my conclusion: I realised that no matter which way I go, I'm going to have to make a custom state machine either way. And I realised that it shouldn't be too difficult to make a state machine, then create a custom editor for it later on. So I think I'm going to do the easy route for now
thanks @golden needle @open ember
CptnFabulous thanked John777, luta
you can see my AI system here @tough lily http://hg.desu.io:8000/file/tip/DyingAndMore/Game/Entities/
a behavior/task driven system
see Tasks/Locomotion and AiController.cs
I made best ai ever:
#include <iostream>
#include <strings>
using namespace std;
int main(){
int age{};
string name{};
cout << "Enter Age: ";
getline(cin, age);
cout << "\nEnter Name: ";
getline(cin, name);
cout << "\nHello " << name << " who is " << age << "!" << endl;
return 0;
}
style transfer with my game screenshots with segmentation based image synthesis by Nvidia Canvas
I've heard of that, its a little wonky
Intriguing. I've already started working on it and it's turning out pretty well so far, but I'll be sure to look at that link. Thanks!
CptnFabulous thanked CobaltHex
i want to go with a diff design than senses but its otherwise pretty modular
Having an issue with entities where they walk in a circle around a waypoint
They can't turn tight enough once they get to certain distance from the waypoint because they have a fixed turn rate
I can't think of a pretty way to fix this. I thought about having the turn rate get higher the closer they are to the waypoint but I'm not a huge fan of that method
having them slow down is the first thing I tried but it didn't work too well
got a vid?
I think one of my patrons has one
could take a bit for them to respond
actually, I had them slow down based on distance before
I should probably have them slow down based on how far they have to turn
this seems to work
big oversight on my part, but thanks!
👍
Can we ad AI in game?
what?
No we cannot games can’t be smart 
If anyone is familiar with the Chao garden from the Sonic games, I'm currently working on recreating their AI in Unity with some improvements. I've made a breakdown of the AI to make things easier when I start building the code, any feedback you guys can offer would be appreciated:
how many people have created a boss fight stage in their game..
just curious
i have
nice!
I’m using Gamemaker 8.1, I know it’s pretty bad but I’m just testing out a bunch of different programs and am wondering how to make an AI shoot something when I am at the same <X axis> as it.?
I think it is more of a gamemaker question, so it is better ask in #gms-dev
Okay thanks
Tyrannz1cal thanked John777
Not sure if I should be posting about this in this channel or unity or something, but can anybody help me with this issue? I'm trying to use Unity's Navmesh system to create AI that goes to an objective while choosing a path that avoids the player in a decently wide radius. In a way like capture the flag. Using a navmesh obstacle on the player would work, except that there are multiple AI that I only want to avoid the player if they see them. Someone else suggested choosing a random point 45 degrees away from the player and navigating to that first, but my map is irregular with a large hole in the middle and other terrain. Any advice?
#unity-dev or #archived-advanced-unity-dev probably
Hey
where can I get help with creating a boss fight is there any videos?
Hello,
How do I use OpenCV in Unity?
Is there an alternative to use Object Tracking & Object Detection?
i recommend finding a tutorial on using open CV
maybe from c#
(if you cannot find one for unity specifically)
google is your friend
I have a working chatbot, i want to integrate it with an anime/3d character that can do proper lip sync according to the words
Is it possible?
yes, but lip sync is a lot of work
elaborate what u need maybe we can help
I’m trying to make a simple boss fight scene. I can’t seem to find a tutorials that is clear enough especially for a 2.5D type of a game
Specifically
I want to program the boss fight scene as : The boss will have a bubble shield around her, and there are 3 objects that once an object is destroyed it will disable the shield giving the player a chance to damage the boss, and also, while the boss inside of the shield, 3 projectiles will spawn to target the player, as an obstacles to make it challenging getting to the switches. That’s all
I just saw your message. I apologize for not getting back to you on time. I have posted specific details regarding the boss fight logic.
and what part are you struggling with?
I'm struggling with setup the pattern
The Boss fight logic
The boss scene will have:
1. The Boss AI
2. Three Generators (Objs)
3. Protective Bubble Sheild (Obj)
4. Three projectiles called (Spirit Eaters)
AI Boss: Will Have 100 pints max Helth, a protective Bubble shield
The player can damage the boss once the bubble is disabled; causing 40 points (damage) to the boss's current health.
in other words, the gamplay logic is : The Scene starts, The Generators will trigger as soon as the player get Within the trigger-zone(Near the boss) if the player enter the trigger zone then the first generator will PowerUp the boss's Bubble, Once the Bubble is (true) the boss will summon His Soul Eaters -(Projectiles) to go after the player. When the playre get to the first generator and destroy it Via (fireball) attack, the Bubble sheild around the boss will be dissabled and once the bubble is disabled if there are any projectiles in the scene they will get disabled as well. then the player will getb a chance to go and damage the boss by (fireball attack) causing 40pts damage as damage value. then the process will repeat once the boss get damaged within 5 sec (if not) then the same phase pattern will be repeated.
So far I programmed the Taking damage/Receiving Damage to both player and Boss.
and I programmed the soul eaters to go after the player as well. now I Just need help with setting the phases and event sequence between the Generator, the bubble and damaging the boss
make a state machine
isn't that for Animations?
its for anything that has states and transitions between them
(i mean this in the abstract sense, not a particular engine concept like unity's animation state machine)
I wouldn’t ask If I know about that, especially how it works and where to use it. I was hoping to see a code example or a video of someone who actually did that in a 2.5D game not a 2D game. I haven’t seen anything but 2D tutorials and not that many are helpful. Thanks anyway.
what kind of 2.5d
also you should be able to do the 2d in 3d and then you can tweak it/improve it from there
Can anybody point out any studies / techniques / experiments on creating AI for card games (like poker or MTG)? (I am aware of minimax and Monte Carlo search tree algos).
you might try a list of patterns
ie. if the board has x abilities out and i have y abilities in my hand, play this set of cards
This approach may work in poker, but in Magic... I have no idea how to look for such patterns. And there probably should be an enormous number of such patterns for it to work well
how many abilities are there?
basic abilities at least?
you can also search by things like type (fire, earth, etc)
been a long time since i played mtg
You can think of any other CCG instead of MTG. I am not sure what you call "abilities" here.
Let's say there are 200 different cards: creatures, spells, enhancements, etc.. At the start of your turn, you can play any number of cards (as long as you have mana for it), many of which need a target, attack with creatures on board either opponent's creatures or hero. So there are a ton of various possible situations and a ton of possible options of what to do each turn.
things like these
there's not that many types
there are probably special cases and they're all slightly different, but you can start with the major types
theres a lot of cards in mtg, its like 30+ years old
Thanks, I get what you are saying, but I am 100% sure that a simple minimax would do better that this approach, unless the number of patterns is huge.
John777 thanked CobaltHex
Maybe idk
idk where to ask in the flood of channels, but I'm looking for a mentor on simple behaviour trees and AI for my school project. If anyone is interested please DM me
Hi. Not sure where to send this so it’s going here. If any other programmers are interested in decentralization and ml, dm me. I have an idea for a project that I would like thoughts on
Yo got a question
We're trying to make a discord bot that takes a bunch of pinned messages from our server, and using an AI, makes new messages based on the input
How could we do this in C#?
i have created one
if any can improve my code you are welcome to contribute
ai code
code is in python
which language
cpp
So I'm trying to make better FPS AI, and just to make sure I understand how GOAP is supposed to work:
- AI has a big list of disconnected actions, each one with prerequisites, a 'loop' where it does the things necessary to complete the action, a completion state and a thing that it does when it's completed
- The AI is given an action to complete from the list.
- The AI checks the prerequisites for the action. If they can't be met, it finds an action that accomplishes said prerequisite (and checks its prerequisites)
- This process loops until the AI has generated a sequence of actions to perform, starting with the one they can do right now and ending with the final goal.
There's also the cost thing, which I presume is used to determine the feasibility of each action if there are multiple possible actions to pick.
Am I correct? I'm trying to wrap my head around it so I can make an AI system that doesn't limit the options I want, without spending ungodly amounts of time on a FSM
maybe?
actions are fairly atomic
the basic idea:
We start our seven layer dip with the basics; the beans. A.I. fire their weapons when they
detect the player. They can accomplish this with the KillEnemy goal, which they satisfy with
the Attack action.
We want A.I. to value their lives, so next we add the guacamole. The A.I. dodges when a gun
is aimed at him. We add a goal and two actions. The Dodge goal can be satisfied with either
DodgeShuffle or DodgeRoll.
Next we add the sour cream. When the player gets close enough, A.I. use melee attacks
instead of wasting bullets. This behavior requires the addition of only one new AttackMelee
action. We already have the KillEnemy goal, which AttackMelee satisfies.
If A.I. really value their lives, they won’t just dodge, they’ll take cover. This is the salsa! We
add the Cover goal. A.I. get themselves to cover with the GotoNode action, at which point
the KillEnemy goal takes priority again. A.I. use the AttackFromCover action to satisfy the
KillEnemy goal, while they are positioned at a Cover node. We already handled dodging
with the guacamole, but now we would like A.I. to dodge in a way that is context-sensitive to
taking cover, so we add another action, DodgeCovered.
Dodging is not always enough, so we add the onions; blind firing. If the A.I. gets shot while in
cover, he blind fires for a while to make himself harder to hit. This only requires adding one
BlindFireFromCover action.
so the states the player is in contribute to the score/prerequisites
ie. if you want to attack and theres 'attack' or 'attack from cover', the latter being more highly valuable, but requires being in cover
not sure if fear does it, but destiny can do some dynamic weighting too
@tough lily ^
Yeah I ended up watching a video that goes more indepth on that game's AI specifically, with that same table
yeah this is from the slides of the talk you probably watched
my game's ai looks a bit different but functions pretty similarly
Although I did notice that in that game they make a notable difference between goals and actions
I have behaviors comprised of a set of atomic tasks (pick target, move to target, shoot at target), that are chosen based on 'senses' which are things like am i under fire, am i low on health, etc
in my system goals = behaviors, actions = tasks, preconditions = senses
their system is more dynamic than mine
(though mines not goal oriented i guess)
Anyone here ever used so to test out a game?
?
@patent blade Could I DM you a quick question?
? Why
Was curious if you'd be open to consulting or a job
Guess asking here was fine 😛 Sorry
Mmmm yes i love when my ai decides to run away from you when it sees you instead of towards
Running towards the player is often the worst self preservation decision an AI can make 🙃
Its horror game where it hunts you, self preservation isnt really included
In a gun/knife fight, running towards the player is the best bet if the player has a gun and you're less than 20ft with a knife, or some monster stabby thing ( https://www.youtube.com/watch?v=Upxfo_jBrDE )
the, 21-foot rule eh. I'm running from doom guy every chance I get.
In my game I'd like to have the AI constantly running simulations with self play, to get the answers to these questions. And self-play against predictive models of each player, so you're fooked unless you destroy the hive mind before it gets too good
is the hive mind reset each game?
No, persistent
sounds like a bad time for the players once it's trained..
(if the goal of the AI is really to dominate the players)
And the world is semi-persistent, there is a war, players will have to band together when areas get too smart. The game plays until one side completely dominates and wins the war
Sharded servers, shared hive mind. Also integrating GPT-3, because I found an amzing trick GPT3 can do
I had to look up GPT3. Haven't done any learning stuff myself. the AI's have always been.. "designer"
designed to be stupid enough to fight, when the best choice was usually just to turn tail and run 🙃
Ok, so GPT-3 is nuts. Lemme dig up an example
(Sales Pitch To Ppl Here: We are hiring, so if this shit interests you, hmu)
Is it spam if I post a lot of lines here? Should i link instead?
I don't think you'll get spam filtered.
The link may be provide a more legible experience though.
k these are my scrappy notes, the GPT-3 stuff is my side project I hope to integrate, but here's a few. I made progress since then under company time I can't share using GPT-J. https://ctxt.io/2/AABgR9LuEQ
I trained OpenAI Codex to turn english typed messages to characters into sequences of code the characters execute
But my fav is the interactive story example, and how GPT-3 knows how to advance the state of the scene with such little information
Which part of the game is going to be generated by GPT-3?
The previous example was for dialogue and behaviors of NPC characters?
Is the whole scenario GPT-3 driven?
GPT-3 can: Procedurally generate puzzles for games, scenarios for games, it can generate character behaviors (not just dialog) given what is happening in the scene.
And it can turn english commands into code sequences for units to execute
Well, GPT-J really, which is a mini version you can run on a private machine that's tuned to your needs
i gotta look into this!
way to start in that? also anything to look into that could teach someone how to properly combine utility ai with other techniques?
Hello,
I'm a High School Student and I have experience in Unity & C# & Python & OpenCV and make many games and published them.
I need an project idea for a Contest in field of AI & Computer Vision and this idea should be practical and not repetitive.
If you have an idea, please guide me. 🙏
If you're interested in Computer Vision, why not try a classification task? A friend of mine recently asked about "Shazam for Bird Calls" and I don't have the time to pursue it currently. I'm sure there's plenty of training data available online and a lot of the techniques from CV translate well to time-series / waveform analysis
It's very good Idea but I don't have any experience in Song Identification and I have a month and a half to build.
In that case, why not bird species identification? Still pretty close and plenty of training data online
Could just use photos instead, which will let you leverage your CV experience
Are you sure this plan is practical and useful?
I mean, for someone who enjoys bird watching yes
Hi, I need help, I have a reinforcement learning program written in python with my own libraries and I would like to try to test it on Minecraft, but there are some problems,
The population is made up of at least 100 players, but there is no computer that can handle such a large number of clients.
Don't you know of something (some mode) that would allow me to create 100 mobs in 1 world who would be able to export their image of what they see (144 x 81 resolution) to a python and receive information about movement and activity from it?
(I only know the basics in java and I don't know the syntax of minecraft mode)
Reminds me of how this didn't age well https://xkcd.com/1425/
i have a full time job, thanks though
CobaltHex thanked dabbr
(I offered him a better job without knowing shit. I meant to say we are competitive)
i mean you dont know my current job...
he's obviously offering a $5Million a month NFT job
Wow, I worded that poorly... was only $1M a month
Is this a good place to talk about neural nets?
had you try it
if any problem in code just tell i will fix it
Yes this is AI/ML
!dontask
Ah...
Neural nets learn through trial and error
I need help with the smallest NN that is considered a NN and therefor I'm doing all the math myself
It needs to learn from 8 input neurons and have 1 output
inputs are of type float and output is a boolean
The inputs are as follow :
• PointA.x
• PointA.y
• PointB.x
• PointB.y
• PointC.x
• PointC.y
• PointD.x
• PointD.y
The evaluator will use the simple "Does line AB and line CD cross" to determine if output should be true or false
it can only be considered a NN if it predicts the correct answer more than 90% of the time (After training)
Once again, no external libraries. If I can't do the math myself, this whole project is pointless
Ping me for more details
just go through tensorflow tutorials or something
also I've never heard of the 90% correct criterion for neural networks
If it can't manage at least 90, then how do I know it's not getting answers correctly by pure chance?
well technically 51% is where you can draw the line of pure chance for a boolean output
if you watch some two minute paper videos, you can see where some models have like 30% success, but they are solving hard problems
the fact that "Does AB cross with CD" is a simple problem, makes it unsatisfactory to get anything below 90%
I understand that for other more complex problems 90% may be unreasonable
Throughout my research I've gotten : Feed forward functionality (Multi layered, biases included)
Back propagation however isn't explained beyond 2 layers
Though I've seen multiple attempts, they often stop at basic theory or show an example that is straight up wrong
I've seen examples of teaching a NN how to do xNor, and that is pretty much hot garbage!
Here is my reason why :
I made a car with detectors, gave it random weights and with miraculous luck it could avoid walls
It had no brain
I hadn't done any survival of the fittest setup whatsoever
I watched the thing for an hour... changed the course, and it still didn't hit any walls
So based on that observation, an xNor is no way to test AI
@elfin vortex, hope you don't mind me pinging you, but you do seem to know a thing or two about NNs
No not that much tbh
And yeah the xor is basically hello world
I'm sort of stuck on how to use heuristics... Like let's say a bot is learning animations, and you provide it motion capture for movement. Would the heuristic for movement automatically be set based on the root motion frame-to-frame during training?
What are some performant alternatives to pathfinding and obstacle detection/avoidance for AI/Mob movement?
have you tried "not pathfinding or avoiding obstacles"? i'm not up to date on anything recent, but flow fields used to be cool for that
flow maps
I'm so bad at coding ai
Would coroutines be a good way of sequencing agent actions without blocking execution for an extended period of time?
sure
does anyone have any experience with nav meshes in open worlds? Is it normal to constrain the player to the nav mesh, and if not how do you deal with the player cheesing melee enemies by running onto non-navigable height field areas
nav meshes are for navigation
make your navmesh more flexible or restrict where the player can go via collision meshes
also add range attacks
and aoe attacks (like grenades)
some games heal the enemies if you go out of range/are unreachable, though imo that design sucks
Yes, it's common to restrict players to where the navmesh is - that's pretty much the point of the navmesh. If there's no navmesh at a location, it specifically means that the terrain is not navigable.
I'm looking for a Game Director library for JavaScript/TypeScript.
A library with help me direct the game state easily and make the game challenging.
what do you mean by that
can you elaborate on what that means/what you want?
Anybody try Replika.ai? I just feel like I'm getting gaslit by a machine to give it money. 
Hello, can someone please explain to me how a very simple neural network works because I want to challenge myself to code it without watching a vid but I don't know fully how they work.
Here's an attempt, although as CobaltHex suggested, you probably should watch some videos explaining Neural Networks.
Essentially, it's a network of neurons. We define a neuron as some object that can map inputs to outputs.
How the neuron maps inputs to outputs boils down to combining the inputs in a certain way using weights and biases.
If you're savvy with linear algebra, the output of a neuron is a linear combination of its inputs.
You can also "layer" neurons in such a way the output of one is fed as an input of another. This might give you more complex behavior but it could be prone to performing "too well". Whether or not you choose to do this depends on your needs.
If you know the weights and biases associated with each neuron, then you're pretty much done (aside from implementing it, of course), but more than likely you won't know this without using some training algorithms.
So basically you feed it inputs and it changes those inputs with certain functions using certain weights and biases. How does it learn then?
In a nutshell, the learning happens by modifying the weights to "fit" with the behavior you want to achieve
As for specific methods, you can look into Backpropagation and Gradient Descent. The main idea is to minimize the "error" of the neural net's outputs from the expected outputs.
If you're going for something more in line with Reinforcement Learning, you can also do something like NEAT. The main idea being close to a genetic algorithm (keep the best performing NNs, breed them, and prune the rest)
So your basically saying just to kind of "evolve" the net by slightly changing the weights and biases and then selecting the ones which perform the best and deleting the others?
If so is there a more efficient way of changing the weights and biases to get the bests results in a short amount of time?
That's the idea yeah.
Gradient descent and Backpropagation are a good start.
They minimize the error in an efficient way. As to how, the analogy is like climbing a hill by going up the steepest slope
Are these weights and biases normalized (not sure of that's just a unity term so it just means in between -1 and 1) or are they just any number
So changing it a lot then minimizing it slightly?
Well there's nothing stopping you from having weights that are from -1000 to 1000.
But typically you want to normalize them anyway. It's just more convenient, and also your features / inputs are kept to the same scale
Ok thank you so much I'll try to do some more research and then start coding, do you have a good objective to start with (like moving a circle to a square)
well that's a different idea (and also another approach). It's related to learning rates.
But gradient descent mainly has to do with tweaking your weights towards a local maximum / minimum.
For NEAT, you can try simulating characters trying to reach a goal in the most efficient manner.
Another would be just a simple classifier to get you started (you can look into classifying handwritten digits in the MNIST database)
I'd say go with the classifier if you're interested in ML in general. You can use other models for it as well
The NEAT one is good if you like simulating stuff
Ok thank you I'll probably try to do the first one as I like to design games.
1AKron thanked RandyMartin
alrighty, happy coding!
Anyone done hierarchical task planning?
Hey,
I want to make an AI solver for Katamino puzzle game (the in the picture), any suggestions of algorithms to use besides backtracking?
If backtracking isn't a hard restriction, I suggest just going with the backtracking algorithm.
I was gonna suggest going with Dynamic Programming, but on second thought that would be no different than just going with backtracking.
If you want an improved backtracking algo though (i.e., not just brute force), you can think about pruning. Namely, consider that for each pentomino and each rotation of said pentomino, there are places on the grid where they cannot go. (either because they go out of the grid, or they ruin the shape).
For each grid cell, pentomino and rotation, you can compute and cache in a memoization table whether or not a pentomino in a certain rotation can be placed there.
The search then comes down to checking placing at the perimeter of the current shape made by your AI until you're done or you cannot proceed.
This is assuming you want a "fixed" solution, i.e., the AI should, without a doubt, be able to give you the correct answer.
If you don't have this restriction, you can look into Simulated Annealing. Define a cost function proportional to how the placed shape so far is close to the original and run the algorithm. One issue, though, is representing a solution (because the algorithm requires you to perturb this gradually).
An easy way is to do a KV-map with pentominos and the coordinates of their upper left block. Don't worry about overlap, because you can make a cost function that penalizes overlap
I would like to join the conversation, and thank you for your comment.
The goal is to have a comparison between the backtracking algorithm and another algorithm, and to show that backtracking algorithm is more efficient than the other one (the solve function is already implemented using the Backtracking algorithm).
Do you have a name of algorithm that I can look for?
Thanks in advance!
Amit thanked RandyMartin
A bit weird that you're trying to show backtracking is more efficient, since typically backtracking is roughly the same worst case as brute force search (of course worst case !== typical case and all that, and in typical cases, backtracking will be faster because of pruning the search space). The only alternative is to do brute force, but backtracking is already more efficient than that...
If you want another algo, you can look into my suggestion of Simulated Annealing (SA). However, keep in mind SA doesn't guarantee a correct solution all the time
SA is stochastic, and "greedy but smarter" (meaning, it's like a greedy algorithm but it doesn't converge to local extrema as often).
I know it's a bit weird, however, I have to explain why I chose this algorithm, and in the explanation I need to give good reasons for choosing this algorithm.
Is the SA/SA considered as algorithm?
SA is an "algorithm". (In quotes because, mind you it's not deterministic, but I'd say it's still a solution you can look into for your problem).
I will say, you can probably justify backtracking simply by proving your problem is NP (this would be my suggested method). NP problems, as of now, don't have a good deterministic solution other than brute force search (so backtracking is already good enough)
A starting point to proving NP-ness is that it's easy to verify when your solution is correct. (time proportional to grid size, so it's polynomial time in this case),
However, generating your actual solutions requires you to do some form of Constraint Satisfaction Problem. (and you can probably phrase the Katamino problem as one). Hence, it will require non-polynomial time to find.
This is by no means an exhaustive proof, just a suggested one.
sorry in advance, I just like this theoretical stuff. Since real life social networks can be represented as graph structures / knowledge graphs, any examples or concept using graphs in AI-AI / AI-Player interactions? would there even be an advantage to this?
recently I've become interested in emergent AI behavior and was thinking of some ways one could achieve that. might be barking up the wrong tree with graph structures, but it seems like an interesting concept to me: store entities and concepts as nodes, and contain labeled edges to those nodes to represent relationships.
I can see an application for something like that in a 4X strategy game that has AI diplomacy. Have a graph representing the relationship (i.e., are these two players in good / bad terms), and have the agents take these relationships into consideration. This doesn't necessarily have a name, but it could be an interesting thing to make.
More generally / abstractly, and even without using an explicit graph data structure, you can simulate multiple entities that can send stimuli to other entities. These entities can then respond to these stimuli, and other entities can respond to these responses and so on. This has the potential for some emergent behavior
could definitely see their use in 4x. thanks @candid magnet
justjude97 thanked RandyMartin
Thanks again for replying. I have read some docs about the SA algorithm but haven't understood yet how it is relevant to the algorithms that can solve the puzzle.
Amit thanked RandyMartin
it's a technique you can apply in an abstract sense.
Try to translate your problem so that it's compatible with SA. I 've sent a suggestion on how to go about it
Graphs are great for lots of things but you're describing knowledge representation only. Nothing emergent or ai there.
Hello, I was wondering if anyone knows anything about Garry’s mod and how to take to make In real life human lookalike NPC my buddy had one but the guy who dose them is no longer doing it at it looked exactly like him! If anyone is familiar or dose it please give me a PM
this is graphics not AI
you probably just need to do some 3d modelling or face scanning
What software for that ?
Regular 3d modelling for the first,latter idk probably very expensive
for a simple evolution game like this, how would I go about making the collision for high speed objects far better? Should I use raycasting?
yes
I have a puzzle game it works on a grid like soduku, your score increases based on your decision on turning tiles on and off, now I want an algorithm that can calculate the best achievable score or something that can at least guess what a good score is supposed to be like, I tried minimax but it's so slow, is there any other fast way for calculating best score in a grid?
Minimax can work fast if you use some alpha beta pruning. If memory isn't a concern, you can use some transposition tables and IDS (Iterative Deepening Search) to speed it up even more.
Although, depending on your puzzle's complexity, I would suggest just making a quick and dirty heuristic based on the features of your puzzle (i.e., maximize what makes a "good" score). Keep in mind this requires some experimentation on your part
@candid magnet the game rules are like this: for example on a rectangular grid i can put blue tiles anywhere I want (score of 1) then there's red tiles (score of 5) can only spawn in places where blue tiles are the direct neighbours, there's green tiles (score of 10) that needs a blue and red tile and the rest just like this...
I could play all my levels and make an estimate but I'm on time limit so I figured to do it with an algorithm
If such is the case, I can imagine a greedy solution that goes like this:
Let's restrict the problem to just 3 types of tiles with the rule set, but feel free to add more.
Blue (1 pt) - can be placed anywhere
Red (5 pts) - can be placed only on a tile adjacent to a blue tile
Green (10 pts) - can be placed only on a tile adjacent to both blue and red
Start with an empty grid.
Perform a sweep through the grid, going left to right, top to bottom.
The first tile you place is blue (if you have more tiles that can be placed with no restrictions, pick the highest scoring one)
For the remaining tiles, place the tile that gives you the highest possible score, and which is allowed by your ruleset.
Certainly faster than minimax (which can grow exponentially without pruning or with bad leaf ordering). This algo is just quadratic on the grid's dimensions.
Do note, if you want a more accurate, perhaps look into running a few passes of this algorithm on the grid, except you try to find tiles you can "increase" the score of. It may help, as well, to do this pass in a "cocktail shaker" like fashion (going top to bottom, left to right for the first pass, then right to left, bottom to top on the second). This is because you may have placed tiles that can change other tiles and give you a higher score
Well it can certainly work as a base I can try greedy algorithm with some extra rules, I'll try that and see what happens, thanks for the guide
Hey,
What advantages there are to use Minimax algorithm over Expectimax algorithm?
From what I can tell. Expectimax deals with non perfect information games. Games that have random chance involved in their game state. Minimax is designed to operate on a fully observable environment, and searches for the most optimal play (to the end of the game) at whatever state you start at
In chess, what advantages there are?
So, it seems that expectimax takes the average value of all the final states (the expected value). GfG says that this allows the algorithm to take risks. Chess is a fully observable, deterministic, environment. Each player can only move one piece at a time and has fully view of the knowledge board.
The default implementation of minimax searches the entire state space in chess to fond the most optimal play. This is impossible in practice due to the sheer number of plays chess offers, but if you could then the minimax player would win everytime (in fact minimax with a cut off at a certain depth is still a good performer in chess).
Expectimax is going to naturally try and take a risk. Now, this may not be totally accurate (and also depends on the cost function), but say you could gain an advantage by losing a valuable piece such as a queen, and the opponent played in a certain way. Minimax may not even consider that advantage due to the local minimum (losing that queen, bishop, ect). Expectimax will take the average of all possible scores resulting from that move and may take a leap of faith.
May not be the most accurate explanation. But in general (according to geeks for geeks) a minimax player assumes optimal play from an opponent, and thus is adverse to any risky plays. While an expectimax algorithm doesn't assume so
Hey guys I'm part of an Austrian startup and we are developing an AI-software to build 3D architectural assets without coding. We are looking for some cool devs (because we don't have full blown game dev experience) who would like to try out the software just to get some feedback and understand your thoughts! 🙂
That pic is an example of what we did earlier and exported it to UE4 🙂 Glad to hear your thoughts! Feel free to PM 🙂
Thanks 😄
Itay113 thanked justjude97
Hello.
I'm a a bit confused about the differences between Backtracking and Brute Force algorithms.
I have read few docs, but still not sure...
In my case, there is no best solution, and every solution is ranked good.
That's why backtracking is suitable for my case.
The question is, if Brute-Force scans for all the solutions, doesn't it have a stopping condition?
https://www.javatpoint.com/brute-force-approach
generally brute force just tries for every pattern from the start
so if I want to find foo in a string
search through the string at every position for foo
backtracking tries to go back to a known 'good' place and continue searching
what that means is dependent on the problem
So brute-force doesn't present all the possible solutions?
it does, but can stop early if it runs into a solution that satisfies the problem. think of a maze. a brute force algorithm will start over from scratch it runs into a dead end; backtracking will start back from an earlier point (as determined by the algorithm) and continue on from there. as far as I understand it
might be misunderstanding this but backtracking may be something like brute-force with "save points"
When it comes to state space search, are there optimisations that are typically used beyond just heuristics (some greedy A*)? I am not finding much literature on the topic, and I fail to see how standard path finding techniques would be relevant here.
I'd recommend just keeping your search space small and delegating any logic you can into other systems
making an ai is on my bucket list
ok
are someone familier with running servers?
yes
Hey,
I have a question about Alpha Beta Pruning algorithm, I am trying to understand this algorithm and I didn't completely understand something, if when calling to min node beta value not sent (it received at initial +infinity) so when this node gets a value from the first child does the beta variable also get the node value?
can someone teach me how to actually get into making ai and get one thing to make something based on what i give it?
look up GOAP and behavior trees
trying to build an ML based AI is probably out of your reach (requires probably thousands of hours of training)
also no guarantee it will behave how you want
ML is still too heavy even if you know what you're doing
I mean you're looking at like 4+ gigs of VRAM and like 80% GPU utilization for something that can even half-ass display a "personality" at all, and that's only if you can settle for personalities that easily are confused into saying nonsense
RNG exists lol
Unless your game has full physics and interactivity (where ML agents can actually do things), chances are there’s a finite number of choices the characters can make, and randomly picking from a decision tree is good enough
I haven’t seen much ML research for interactive game agents in the emotional aspect, definitely more that are perceiving or moving
So yeah traditional AI is probably better at this scale
Not completely unpredictable, but look into GOAP and HTN. HTN is basically an evolution of GOAP. It does take a good bit of setup to get working and can be harder to debug than something like a BT.
You can easily get good results with any of these and once you do, it's way easier to just sprinkle some ML/DL on top.
A practical way to use ML would be to make a traditional decision tree AI character that is a bit too unpredictable, and then you can use a neural net to bias your RNG, instead of as a decision engine, which is way cheaper.
That approach gives good results, even with neural nets small enough to run on the CPU
btw remember games are also about making things feel fun
they are not about feeling realistic usually
Hey! Just joined and saw the post. Do you have any more details on what kinds of unpredictable behavior you're looking for? Is it that the AI's personality is set at random and then is fairly deterministic, or is the AI supposed to have an identity (personality, traits, etc) that then has various tics that are unexpected (or both)? I like Grimmie's answer when the AI is trying to get to a particular goal but then changes up its behavior along the way - say, disagreeing in a conversation but then saying it differently in each encounter. (Edit: Thought more about it, and maybe a random goal for STRIPS/HTN/GOAP may make sense; I was thinking of modifying the transitions a bit to be probabilistic.)
I am a beginner in game development . I am working on a project in which I am trying to automate 3d character facial expression according to the input. Let's say I have neural network trained and ready for this. Now I want to change the mesh of my 3d character face according to the input from neural network. I have been trying doing this from blender. I have been successful in doing lip movement through python script in blender. But I am not sure if blender is the best option for this. Problems I am facing through blender is that the animation is not happening real time. Even through python script it first creates the animation then I can run it. Secondly, I am really confused on how I will deploy my project with blender.
For any experienced developer out there, it would be really helpful if you can suggest or give your opinion on this.
Has anyone gotten invites to openai projects?
im waiting for DALLE
I have this really cool idea I wanna experiment with
use GPT-3 to describe a bunch of planets and then DALLE-2 to generate textures/geometry to represent them
and then have GPT-3 write basic behavior code for the 'life' on that planet
I feel it might be possible to ask DALLE 2 for a bunch of angles of the same picture and then use that to extrapolate geometry
I am running dalle mini and it's not that good, was wondering if the actual model will be better.
Hello there! We had this idea to rebuild old Text adventure games using AI (use tts + text to video) to generate interactive stories, what do you think about it? Here is short demo of how it could look like https://scena.link/r/little-prince - content was made out of text + images from pexels
Have you tried nvidia omniverse audio2face?
Behavior trees are interesting, how would someone implement this?
Any good resources to learn it?
what have you found
i'm making AI for a demo and I've only done a fairly rudimentary one before (in UE). i'm wondering whether there are any good sources on basic/foundational best practices in a broad/general sense (where to start is fine), just to hopefully reduce the amount of misdesign.
the best practices are probably inherently tied to the functionality of the engine. might be shit question
Hey, that looks interesting. I actually came here looking for use cases of ai-generated assets in game dev
look up GOAP
youtube has some good overviews too
found a couple of videos that looks to be exactly like what i was hoping for. thanks!
Guys i have been wanting to go into the domain of ai from a long time ago, does anyone have some books or videos about learning python from scratch ai based
For reactive and group oriented FPS AI which is easier to implement for a developer:
behavior tree
finite state machine
goal oriented
utility ai
and what would you (anyone here) say is the best approach?
behavior trees have the same problem that inheritance trees do
it's hard to mix-match styles
finite state machine is a more broad concept. I'd argue all of these implement a state machine
!Rules
You can view the rules in #rules
Or type /rules <number> to check a specific rule.
Hey! Maybe someone has any good reference of implementations of event driven behaviour trees? Specifically, I can't wrap my head around how to combine them with hierarchical state machines and quick github search yields nothing, sadly.
what is the use case?
Hi all, i have been working on this text/code generator recently - can save a lot of money switching to Text-Generator.io from using OpenAI text generation 🙂 https://text-generator.io/blog/over-10x-openai-cost-savings-one-line-change
Made this game with Text-Generator.io too: https://www.addictingwordgames.com/play-game/20-questions-with-ai It's open ended really but the goal was you have to guess what the AI is thinking/get it to admit you know what it is thinking atleast 🙂
Ok....