Click here to Skip to main content
15,896,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDoes CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
ForNow20-Jul-17 15:55
ForNow20-Jul-17 15:55 
AnswerRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
Richard MacCutchan20-Jul-17 20:34
mveRichard MacCutchan20-Jul-17 20:34 
AnswerRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
Jochen Arndt20-Jul-17 21:00
professionalJochen Arndt20-Jul-17 21:00 
GeneralRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
ForNow21-Jul-17 3:05
ForNow21-Jul-17 3:05 
GeneralRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
Richard MacCutchan21-Jul-17 3:24
mveRichard MacCutchan21-Jul-17 3:24 
GeneralRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
Jochen Arndt21-Jul-17 3:35
professionalJochen Arndt21-Jul-17 3:35 
Question《programming game AI by example》 Pin
bestbear19-Jul-17 20:11
bestbear19-Jul-17 20:11 
AnswerRe: 《programming game AI by example》 Pin
leon de boer19-Jul-17 20:51
leon de boer19-Jul-17 20:51 
You write the search algorthim as an iteration, with adjustable resolution and trigger(s).

If two objects are more than X apart the search doesn't run at all unless there is a special trigger. If you haven't been "spotted" there is no need for an enemy to search and so they usually just walk a defined set of waypoints called "pathing".

So movement especially for NPC's or bots usually have two different behaviours being "pathing" and "searching". Often there is also a way to get "unspotted" and NPC's/BOTs may be leashed to some co-ordinate. If they get more than some distance from the leash point they will drop "seaching" behaviour and resume "pathing".

The trigger whatever that is usually establishes the "target" and it is at that point the search AI kicks in. The game design thus far made sure searching is used sparingly.

Now when the search algorthim kicks in, it sets a resolution grid based upon how far the target is away. You don't need a fine grid for a target far away. So you will have a raycast which you run to each point on the grid. So when target is a long way away you still only get a small grid just they represent a big distance. That is the bit your code you currently have probably doesn't do and so you have a huge grid when the target is a long way away.

So now with your grid you run the AI search algorthim to work out what direction to move to the target allowing for walls etc. If the target is a long way away the direction will only be rough but that is all it needs it will fine up as it gets closer.

The problem you probably have with the AI search they have given you is the grid is massive and it gets bigger and bigger the further a target is away.

That would be how the vast majority of games not just MMORPG games work. Suggested start point for reading
Near-Optimal Hierarchical Pathfinding (HPA*) | AiGameDev.com[^]
In vino veritas


modified 20-Jul-17 3:34am.

GeneralRe: 《programming game AI by example》 Pin
bestbear21-Jul-17 2:12
bestbear21-Jul-17 2:12 
QuestionHelp with Heap Corruption "Critical error detected c0000374" Pin
ForNow19-Jul-17 13:47
ForNow19-Jul-17 13:47 
AnswerRe: Help with Heap Corruption "Critical error detected c0000374" Pin
leon de boer19-Jul-17 20:16
leon de boer19-Jul-17 20:16 
GeneralRe: Help with Heap Corruption "Critical error detected c0000374" Pin
ForNow19-Jul-17 21:42
ForNow19-Jul-17 21:42 
GeneralRe: Help with Heap Corruption "Critical error detected c0000374" Pin
leon de boer19-Jul-17 22:05
leon de boer19-Jul-17 22:05 
GeneralRe: Help with Heap Corruption "Critical error detected c0000374" Pin
ForNow20-Jul-17 6:43
ForNow20-Jul-17 6:43 
GeneralRe: Help with Heap Corruption "Critical error detected c0000374" Pin
leon de boer20-Jul-17 17:29
leon de boer20-Jul-17 17:29 
GeneralRe: Help with Heap Corruption "Critical error detected c0000374" Pin
ForNow21-Jul-17 2:47
ForNow21-Jul-17 2:47 
GeneralRe: Help with Heap Corruption "Critical error detected c0000374" Pin
leon de boer21-Jul-17 3:35
leon de boer21-Jul-17 3:35 
AnswerRe: Help with Heap Corruption "Critical error detected c0000374" Pin
Jochen Arndt19-Jul-17 21:36
professionalJochen Arndt19-Jul-17 21:36 
GeneralCards.dll Pin
Member 1171866719-Jul-17 1:40
Member 1171866719-Jul-17 1:40 
AnswerRe: Cards.dll Pin
Jochen Arndt19-Jul-17 3:29
professionalJochen Arndt19-Jul-17 3:29 
GeneralRe: Cards.dll Pin
Richard MacCutchan19-Jul-17 4:59
mveRichard MacCutchan19-Jul-17 4:59 
GeneralRe: Cards.dll Pin
leon de boer19-Jul-17 5:54
leon de boer19-Jul-17 5:54 
GeneralRe: Cards.dll Pin
Richard MacCutchan19-Jul-17 6:58
mveRichard MacCutchan19-Jul-17 6:58 
QuestionCompiler generated code Pin
ForNow13-Jul-17 14:43
ForNow13-Jul-17 14:43 
AnswerRe: Compiler generated code Pin
leon de boer13-Jul-17 16:43
leon de boer13-Jul-17 16:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.