
Advertisement

Popular Tags

Popular Now

Advertisement

Similar Content

By GytisDev
Hello,
me and few friends are developing simple city building game with unity for a school project, think something like Banished but much simpler. I was tasked to create the pathfinding for the game so I mostly followed this tutorial series up to episode 5. Then we created simple working system for cutting trees. The problem is that the pathfinding is working like 90% of the time, then it get stuck randomly then there's clearly a way to the objective (tree). I tried looking for some pattern when it happens but can't find anything. So basically I need any tips for how I should approach this problem.
Use this image to visualize the problem.

By AlphaWolfKing
Hi everyone, as summer approaches and the college semester comes close to ending. I want some books or resources you would reccomend to a beginner video game programmer.
On a side note, what are the important calculus topics that are applied to programming video games?

By Agisis
Hello.
We have released our game, "Dominari Tournament", to Early Access on Steam. It has been in development for 2.5 years. Gameplay reception is positive from all playtesters. One feedback we have received is that the battlefields surrounding artwork is too flat and needs to have more depth. We are seek to commission an artist to redo that specific piece of border art with a a futuristic tech/space look and feel. My artistic ability has reached it's limits and we need a professional for this task..such as yourself!
Here is a screenshot of our game play interface.
Below are a few screenshots of the STYLE of work we are looking for. Mechanical, with glows and other metallic artwork. Resolution is 1920x1080. Work would be specifically limited to the existing surrounding artwork, no gameplay graphic changes.

By owenjr
Hi there!
I am trying to implement a basic AI for a Turrets game in SFML and C++ and I have some problems.
This AI follows some waypoints stablished in a Bezier Courve.
In first place, this path was followed only by one enemy. For this purpose, the enemy has to calculate his distance between his actual position
to the next waypoint he has to pick.
If the distance is less than a specific value we stablish, then, we get to the next point. This will repeat until the final destination is reached. (in the submitting code, forget about the var m_go)
Okay, our problem gets when we spawn several enemies and all have to follow the same path, because it produces a bad visual effect (everyone gets upside another).
In order to solve this visual problem, we have decided to use a repulsion vector. The calculus gets like this:
As you can see, we calculate the repulsion vector with the inverse of the distance between the enemy and his nearest neighbor.
Then, we get it applying this to the "theorical" direction, by adding it, and we get a resultant, which is the direction that
our enemy has to follow to not "collide" with it's neighbors. But, our issue comes here:
The enemys get sepparated in the middle of the curve and, as we spawn more enemys, the speed of all of them increases dramatically (including the enemies that don't calculate the repuslion vector).
1  Is it usual that this sepparation occours in the middle of the trajectory?
2  Is it there a way to control this direction without the speed getting affected?
3  Is it there any alternative to this theory?
I submit the code below (There is a variable in Spanish [resultante] which it means resultant in English):
if (!m_pathCompleted) { if (m_currentWP == 14 && m_cambio == true) { m_currentWP = 0; m_path = m_pathA; m_cambio = false; } if (m_neighbors.size() > 1) { for (int i = 0; i < m_neighbors.size(); i++) { if (m_enemyId != m_neighbors[i]>GetId()) { float l_nvx = m_neighbors[i]>GetSprite().getPosition().x  m_enemySprite.getPosition().x; float l_nvy = m_neighbors[i]>GetSprite().getPosition().y  m_enemySprite.getPosition().y; float distance = std::sqrt(l_nvx * l_nvx + l_nvy * l_nvy); if (distance < MINIMUM_NEIGHBOR_DISTANCE) { l_nvx *= 1; l_nvy *= 1; float l_vx = m_path[m_currentWP].x  m_enemySprite.getPosition().x; float l_vy = m_path[m_currentWP].y  m_enemySprite.getPosition().y; float l_resultanteX = l_nvx + l_vx; float l_resultanteY = l_nvy + l_vy; float l_waypointDistance = std::sqrt(l_resultanteX * l_resultanteX + l_resultanteY * l_resultanteY); if (l_waypointDistance < MINIMUM_WAYPOINT_DISTANCE) { if (m_currentWP == m_path.size()  1) { std::cout << "\n"; std::cout << "[GAME OVER]" << std::endl; m_go = false; m_pathCompleted = true; } else { m_currentWP++; } } if (l_waypointDistance > MINIMUM_WAYPOINT_DISTANCE) { l_resultanteX = l_resultanteX / l_waypointDistance; l_resultanteY = l_resultanteY / l_waypointDistance; m_enemySprite.move(ENEMY_SPEED * l_resultanteX * dt, ENEMY_SPEED * l_resultanteY * dt); } } else { float vx = m_path[m_currentWP].x  m_enemySprite.getPosition().x; float vy = m_path[m_currentWP].y  m_enemySprite.getPosition().y; float len = std::sqrt(vx * vx + vy * vy); if (len < MINIMUM_WAYPOINT_DISTANCE) { if (m_currentWP == m_path.size()  1) { std::cout << "\n"; std::cout << "[GAME OVER]" << std::endl; m_go = false; m_pathCompleted = true; } else { m_currentWP++; } } if (len > MINIMUM_WAYPOINT_DISTANCE) { vx = vx / len; vy = vy / len; m_enemySprite.move(ENEMY_SPEED * vx * dt, ENEMY_SPEED * vy * dt); } } } } } else { float vx = m_path[m_currentWP].x  m_enemySprite.getPosition().x; float vy = m_path[m_currentWP].y  m_enemySprite.getPosition().y; float len = std::sqrt(vx * vx + vy * vy); if (len < MINIMUM_WAYPOINT_DISTANCE) { if (m_currentWP == m_path.size()  1) { std::cout << "\n"; std::cout << "[GAME OVER]" << std::endl; m_go = false; m_pathCompleted = true; } else { m_currentWP++; } } if (len > MINIMUM_WAYPOINT_DISTANCE) { vx = vx / len; vy = vy / len; m_enemySprite.move(ENEMY_SPEED * vx * dt, ENEMY_SPEED * vy * dt); } } }
¡¡Thank you very much in advance!!

By SinnedB
Hello,
I am not sure if I phrased the title properly. What I am trying to achieve is the following:
Winning chances:
Red card: 10%
Blue card: 20%
Green card: 15%
Nothing card: 10%
Now a player has the chances above to win those cards but how would that look like in code?


Advertisement

Advertisement
Sign in to follow this
Followers
0
Optimization When I do a spatial partition, how often should I insert/delete entities?

Advertisement