Jump to content

  • Log In with Google      Sign In   
  • Create Account

BaneTrapper

Member Since 04 Jul 2012
Offline Last Active Jul 31 2016 02:59 PM

Posts I've Made

In Topic: All Jokes aside, what is 6/2(1+2)?

07 May 2015 - 02:56 PM

Got rekt so hard, i blame that i am tired unsure.png


In Topic: Issues with IDE Linker? Why is this happening, and how do i fix it?

10 April 2015 - 02:45 PM

I also strongly recommend using #pragma once instead of include guards to avoid this sort of thing.  It gets especially silly in larger projects where you'll often have multiple files with the same name.

But isn't #pragma once MSVC only? is it crossplatform?, if not. That's why i use #include/


In Topic: Issues with IDE Linker? Why is this happening, and how do i fix it?

10 April 2015 - 10:23 AM

Oh god, i forgot to update, i fixed it. Header guard had name conflict... 

And yes, thank you for help. I decided to find issue my self, and i forgot about this post. I Was stuck for some time, and i was getting nowhere so i felt supper down. I really appreciate your help!


In Topic: A list of commands for units in 2D RPG, a way to handle it.

18 January 2015 - 05:25 AM

I accidentally clicked away pressed backspace and lost about 30minutes of text(20 lines) :| so here we go again... For some reason the written text was not saved when i got back in wacko.png I will shorten it up.

Why did you ask for opinions and suggestions if you don't want to listen to anyone's opinions or suggestions?

I have thoroughly read your opinions, and i have even added  a check for actions as you have, i stated i would be posting my code later on smile.png. At the time i was making first post i was going with templates, and variadic template for the list. It wasn't working at all. As a matter of fact, the way i am doing it is very similar to yours ApochPiQ, i would go as far to say the idea is exactly the same, i just implemented it in a different way, its implemented in a way to suit my code design that is already in place so i don't rework it all.

 

 


Final thought - having nested order queues is very powerful. For example, if I want to treat "go to the nearest quest giver and get a quest and then try to beat the quest" as a single atomic order, I could do that in two ways. Either I build a really complex ActionDoTonsOfComplicatedStuff object, or I write a single ActionDoMultipleActions. ActionDoMultipleActions is just a copy of the code that invokes ActionInterface::Execute(). Using this nested structure I can create arbitrarily rich flows between orders (oops, I can't do X! Better pop out a level and do Y instead!) and so on. You can even build more complex logic in if you want, so that orders can cancel each other, suggest other courses of action, etc.

Yep. One way of implementing such a "nested order queue" (in principle only, because it were not really a queue) with break points and alternatives and prioritization of what to do and ... already build-in is the behavior tree (just to throw in this term ;) )

 

 

 


I have made a prototype, and i am happy enough to go with it, i want to finish the game. Or at least make the AI be smarter then a empty box.

It is okay if this is your goal, and/or if the game is a, say, personal study on the way to evolve. But in the end I'm seconding ApochePiQ, in both roles as a developer as well as a player. An NPC that is not able to react on world state changes is what is looking really stupid. If a NPC follows a once planned action list stubbornly without the ability to break and restart elsewhere, then noticeable chances are that the NPC gets stuck somewhere and try forever, and a player observing the NPC simply shakes the head. You have to answer the question how probable that is and how much the game will suffer if it occurs. Worst case, of course, is that the game will be unplayable. With this in mind, having a game finished is not to be judged on the criterion of superficially seen code completeness, but also on its usability as a game.

 

I have added a check system for actions, it will handle those cases if unit got stuck intro a corner of house and surrounded by objects, by asshole player. It will get it self out. If it has to destroy the objects player placed, then it can. Its handling cases like those when unit is pathing, and there is no path to the end position. It can modify the world in order to get there. If it means start hacking away at a big mountain so be it! although to prevent stupid cases like that i got a road system, and units while traveling from location to location will stick to the road.
If even the road got blocked by a troll played that put allot of boxes on the road to block it. Unit would try to find path using pathfinding from last path node to next one, and last node to the final one. If it still failed, well then its the mountain hacking scenario.

 

But for a person doing AI first time, its a hard task getting AI to even work, making it smart is very complex, but doable.


In Topic: A list of commands for units in 2D RPG, a way to handle it.

17 January 2015 - 07:00 PM


glportal, on 17 Jan 2015 - 11:38 PM, said:
Hello BaneTapper,
...
Hello to you too Henry.
What i am doing is AI for units, at time of postings units knew how to do tasks(move to location, attack, idle, check if enemy radius...)
The engine handles units data, and reacts accordingly, if unit flag for movement is set to move on given path, it will read from units path list, and lead unit on the path until the path list is done.
What i wanted for units to have is memory of their actions, here is a example why:
Unit is assigned a path, and is walking on it. If unit spots a enemy in sight radius it will decide, should it run, or fight the spotted enemy, now i can set flags for movement to walk to enemy, or run away from the enemy, but in process i lost the path unit was walking before.
 
That was my problem i was trying to solve, i decided unit needs a action list. With action list, if unit was walking a path, and spotted a enemy. It would push a new action on top of the stack, thus remembering its previous actions, while allowing new ones to execute.
 
Now in the first post i really did try hard to simplify it, i am doing it right now, when unit spots a enemy unit allot of actions are set, but i was very simple(stating it would only push one action) for sake of understanding.
 

ApochPiQ, on 18 Jan 2015 - 12:18 AM, said:
I sm...
I started this project with little design, and on top of all i am actually self learned, and read no books on programming or design. I get stuff to work, and that is what i want to achieve. But i do watch lots of educational videos on programming in general, and reading lots of topics to keep up to date with the programming world.
 
The way you designed code, i attempted it when i was starting project, but it just didn't fit, the way i am doing it right now is easier for me, and also is less coding from what i notice, that is my opinion.
 
I suffer from lack of knowledge to explain, and additionally inexperience.
How i handle the "go to the nearest quest giver and get a quest and then try to beat the quest" is:
I first call a function getPathToUnit(position_start, unit_ID); From unit id i track position all time because the unit will reposition in most cases.
The function handles the path generation. Lets start_pos unit is in tavern in town One, and unit_ID unit position is in its House in town Two. The action list ends up looking something like this:
setMoveToEntranceOfBuilding()
setMoveToEntranceOfTown()
setMoveTravelToTown_name(Town_Name)
setMoveToTarget(Unit_ID)
initateDialogWith(Unit_ID)
getQuestFrom(Unit_ID)
But if unit was next to the target the list would look approximately to
setMoveToTarget_Until_In_Radius(Unit_ID, Dialog_Radius)
initateDialogWith(Unit_ID)
getQuestFrom(Unit_ID)
So that is not a one call, because that would be a real nightmare to make. Possible, but unnecessary work, because that big function can be cut up intro many small ones, and they can be reused.
 
I have made a prototype, and i am happy enough to go with it, i want to finish the game. Or at least make the AI be smarter then a empty box.
I will be posting full code when i'm done with prototype, to show how iv'e done it.

PARTNERS