srex Posted December 27, 2016 Share Posted December 27, 2016 Hey, I'm currently developing a web based manager game. I would like to get some input on how to achieve my goal: Creating a Manager game where NPC's will move around based of strategies given by their managers. In the simulation part I would need a game engine and a physics engine to check for collisions etc. would need the NPC's to know they can't run through a wall for example, but I also need a system so I can see if a player standing behind small objects, such as a tree if that player is visible to other players (his arm etc.) The genre would be FPS, such as "csmanager". I would love some inputs on how this could be achieved, I have done tons of research and have an idea. But I would love to hear how you guys would do it Quote Link to comment Share on other sites More sharing options...
The_dude8080 Posted December 28, 2016 Share Posted December 28, 2016 Everything you are asking is done the same way as in a "normal" game where you, or other players, take control of a character. The only difference is that every "player" there is code-scripted. But for collision checks and knowing if player is visible or not is not dependent on whether you are controlling it or not. It is part of the game environment itself. If you are talking about 3D fps physics I would guess that visibility is conditioned by vectors, raycasting, that type of stuff. Quote Link to comment Share on other sites More sharing options...
srex Posted December 28, 2016 Author Share Posted December 28, 2016 Just now, The_dude8080 said: Everything you are asking is done the same way as in a "normal" game where you, or other players, take control of a character. The only difference is that every "player" there is code-scripted. But for collision checks and knowing if player is visible or not is not dependent on whether you are controlling it or not. It is part of the game environment itself. If you are talking about 3D fps physics I would guess that visibility is conditioned by vectors, raycasting, that type of stuff. Yeah there will be 0 movement, it will be like a classic Manager game. Sort of how Football Manager works, just browser based :). so there will be stats playing in with different weights for different situations. I was wondering if anyone had some frameworks they could recommend. I looked a babylonjs and phaser. The "players" input comes by setting strategies, hiring and training players before the game starts. Quote Link to comment Share on other sites More sharing options...
The_dude8080 Posted December 28, 2016 Share Posted December 28, 2016 https://www.quora.com/How-does-the-algorithm-of-the-game-Football-Manager-work this might help Quote Link to comment Share on other sites More sharing options...
srex Posted December 28, 2016 Author Share Posted December 28, 2016 4 hours ago, The_dude8080 said: https://www.quora.com/How-does-the-algorithm-of-the-game-Football-Manager-work this might help Thanks, I read that already. I know how to do it, I'm simply trying to ask for advice in terms of frameworks. Quote Link to comment Share on other sites More sharing options...
b10b Posted December 28, 2016 Share Posted December 28, 2016 My advice is pick whichever framework you are already familiar with - i.e. movement, physics, controllers are present in almost all game frameworks. And / or pick the framework that most closely matches your intended visual output and asset workflow requirements. There may have been more options if you weren't intending to do it in real-time, or show a visual output that exactly matches the outcome. But if that is the goal (like csmanager) then the Manager aspect of your game is a Bot on top of a player controlled game, so all the usual rules apply. Motivating the bots to achieve tactical strategies is an interesting and time consuming challenge, so focus on testing strategies (ideally not in real-time) and how some machine learning can be adopted. I'll add that fixed-time-intervals can be your friend for such games, so consider disabling variable delta time update loops upfront and avoid some gotchas later. Quote Link to comment Share on other sites More sharing options...
srex Posted December 29, 2016 Author Share Posted December 29, 2016 10 hours ago, b10b said: My advice is pick whichever framework you are already familiar with - i.e. movement, physics, controllers are present in almost all game frameworks. And / or pick the framework that most closely matches your intended visual output and asset workflow requirements. There may have been more options if you weren't intending to do it in real-time, or show a visual output that exactly matches the outcome. But if that is the goal (like csmanager) then the Manager aspect of your game is a Bot on top of a player controlled game, so all the usual rules apply. Motivating the bots to achieve tactical strategies is an interesting and time consuming challenge, so focus on testing strategies (ideally not in real-time) and how some machine learning can be adopted. I'll add that fixed-time-intervals can be your friend for such games, so consider disabling variable delta time update loops upfront and avoid some gotchas later. Yea I planned on starting with simply hard coding a simple strategy defensive/aggressive. And yes I want it to be more replay based it doesn't have to be real-time. Thanks for the advice b10 you've really cleared some of the mist for me :)! But as for the visual output, it must match and be 'realistic' so I've been a bit fuzzed as to how this can happen, as in shooter games, there's several aspect as I think should be solved with a "Line of Sight" algorithm to calculate if players can see an opponent. I would need to generate a match's data server sided and then sent to data to be displayed to the user. Of course each time they watch the same match, exactly the same things should occur so yeah it must be if not realistic then at least accurate. But as far as I can understand I would simply load the sprites and navigation meshes for a "level" then find a way to check for enemies in line of sight and start to work with combat and movement flow for the players. <- in terms of the server sided "data generation" First I would just code the game as if it was a normal shooter game, then disable player control and convert it to a simulation game. Quote Link to comment Share on other sites More sharing options...
b10b Posted December 29, 2016 Share Posted December 29, 2016 It might be worth starting with pathfinding - in order to have your units move around, avoid obvious danger zones, and seek cover when available. I suggest this because the same algorithm, likely in it's simplest form, could be used to determine whether a unit can "see" another unit. So you'll get two for the price of one! srex 1 Quote Link to comment Share on other sites More sharing options...
srex Posted December 29, 2016 Author Share Posted December 29, 2016 4 hours ago, b10b said: It might be worth starting with pathfinding - in order to have your units move around, avoid obvious danger zones, and seek cover when available. I suggest this because the same algorithm, likely in it's simplest form, could be used to determine whether a unit can "see" another unit. So you'll get two for the price of one! Thank you so much sir as a last question any particular pathfinding algorithm you'd recommend for this type of game? Quote Link to comment Share on other sites More sharing options...
b10b Posted December 29, 2016 Share Posted December 29, 2016 32 minutes ago, srex said: Thank you so much sir as a last question any particular pathfinding algorithm you'd recommend for this type of game? You're welcome, interesting questions. Pathfinding choices really depends on your map data (segments, tiles, etc). Personally I like to express map data as tiles, and often recommend AStar as a starting point for pathfinding. It's a mostly intuitive algorithm and the fun begins when adding biased and dynamic heuristics. So that is to say that any given tile is not passable or impassable, but may have an arbitrary "score" that means it is still passable but only if the alternative route is especially costly. So in a tactical game, the center of the room would have a higher bias than the edges, so most paths will favour hugging the walls. Over time the map can adjust it's bias, e.g. every time a kill occurs on a tile, increase it's danger score (clearly not a safe place to be!). Or the map data can be filtered based upon the attributes of the player (e.g. lava can be walked on only for units wearing fire-proof boots). Really the sky's the limit, it's just a matter of starting off with something that feels "intuitive" to you and allows easy extension to include all the strategies needed for your game. Or ... you may want to consider that most tactical units do not have perfect knowledge of their map, nor do they have perfect interpretation of their limited knowledge ... so most times pseudo-random is totally realistic! Quote Link to comment Share on other sites More sharing options...
srex Posted December 29, 2016 Author Share Posted December 29, 2016 1 minute ago, b10b said: You're welcome, interesting questions. Pathfinding choices really depends on your map data (segments, tiles, etc). Personally I like to express map data as tiles, and often recommend AStar as a starting point for pathfinding. It's a mostly intuitive algorithm and the fun begins when adding biased and dynamic heuristics. So that is to say that any given tile is not passable or impassable, but may have an arbitrary "score" that means it is still passable but only if the alternative route is especially costly. So in a tactical game, the center of the room would have a higher bias than the edges, so most paths will favour hugging the walls. Over time the map can adjust it's bias, e.g. every time a kill occurs on a tile, increase it's danger score (clearly not a safe place to be!). Or the map data can be filtered based upon the attributes of the player (e.g. lava can be walked on only for units wearing fire-proof boots). Really the sky's the limit, it's just a matter of starting off with something that feels "intuitive" to you and allows easy extension to include all the strategies needed for your game. Or ... you may want to consider that most tactical units do not have perfect knowledge of their map, nor do they have perfect interpretation of their limited knowledge ... so most times pseudo-random is totally realistic! Yeah you're right, it could also be stuff that can be crossed, but will take you longer to move from a tile to another. For example a ladder, a wall that's high but climbale etc Thanks for the great suggestions man I really appreciate it b10b 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.