Jump to content
    1. Today
    2. First off, again there is no "standard implementation" only standard behavior. However there are probably some commonality between implementations. You can imagine memory being an unused paper tape. When you allocate something you draw a line on it. From the begging of the tape to the line is what you allocated. Now if you allocate again draw a line after the first one. That chunk is from the first line to the second line and so forth. But now if de-allocate something you might have a space in the middle that's unused. However it's only the size of the piece of memory that you previously allocated there. It's up to the memory manager to figure out what to do with it. It has to save it somehow so if you allocate new piece of memory that is smaller than that space it can give that piece back to you. However let's say all your following allocations are all bigger than that space. In that case it will never be reused and you have a hole. Now it can get even more complex. Let's say you allocate a piece of memory smaller than that space, so it gets reused. But it's slightly smaller, so a sub-piece of memory that's not big enough to be useful for anything is left over at the end. So now you have a sliver of lost memory. So this is where the memory manager comes in. It might think in advance that this situation is sub-optimal and try to give you a different chunk of memory instead. Then there is the situation where you de-allocate two chunks of memory next to each other. The allocator has to be smart enough to merge them into a bigger chunk. There are really a lot of variables. That's why there are a lot of implementations. Years ago I worked on IBM workstations. Someone brought a program to me and said it was crashing on exit or rather it would go into and infinite loop. After debugging it for a while. I found that it got stuck in the memory deallocator. But it did eventually end after 10 minutes. He was allocating millions of tiny objects. On a hunch I simply replaced mallaoc/free with my own routines and boom, it fixed the problem. The standard implementation was simply way sub-optimal for his particular memory usage model. In general for a lot of things I use slab allocators. You can read up on them. But again they aren't good for everything. It all depends on what you are doing. For a lot of gaming stuff, some form of slab allocation probably works pretty well though. They are basically good where you have a lot of objects of similar size, or objects can be categorized in groups of similar sizes. Strings are it's downfall but you can do a different heaps for those. I use a lot "placement new" in C++ to allocate in different heaps. You can read up on that too. Over the years I have built up a big library of different heap libraries. I try to pic the ones that best suit my job. If you are really trying to optimize memory, there is a lot you can do, but you should try to figure out if it's an issue first. For many people the built in routines work well enough.
    3. Game engines like Unity will always have a large market.. I really doubt that Unity or any other engine like it will ever completely displace major custom engines. You just can't optimize these engines as much as a custom built one. Unity/Unreal/etc are great for small and independent developers though. They allow individual creatives, and small teams the chance to make nice things too. The real difference between custom engines and things like Unity is that custom engines DON'T include 90% of the things that make Unity or Unreal nice/easy to use. That equates to MASSIVE performance gains that you really can't get from DIY game engines. Do most games need that? No, but some do.. And some always will.
    4. Allocators either garbage collect and compact the heap (in garbage collecting runtimes), ask the OS for more memory to expand the heap (ex: VirtualAlloc), return null, throw an exception, or produce some other type of error. Successfully allocated memory is ALWAYS contiguous from the perspective of the program (code assumes that data structures are always arranged the same way). However, protected mode virtual memory allows the addresses that the program uses to map to different actual physical RAM (or even hard drives)
    5. Septopus

      Pub/Sub for game Servers... Are you?

      Those are song lyrics man, not reality.. Everything changes except human perception. We're keying in here on a long standing rivalry between Systems guys and Coders I think.. Every coder I've known takes your perspective on this.. And every network/server guy I've known thinks y'all are crazy. It seems as though coders like to behave like the changes in the hardware never really make any difference because their code never really has to change significantly. Just because it doesn't HAVE to change significantly, doesn't mean it couldn't become something better in it's newer environment if it did. You keep snagging on Redis, I don't think I'm using it how you think I'm using it, it I think. I was considering possibilities for it, earlier on, that proved not to be feasible. Documentation is very helpful. It's just my database man, and a WICKED fast one! Aside from that, yes. I'm building the system to fit the game I'm making. The game I'm making will be different. But I think it also has potential to be a platform for more different games. Possibly even done differently. ... No, certainly done differently. You might be pushing me into a Slogan here! hahaha
    6. There can be no resorting to anything, the promise of contiguity shall not be broken - if you demand a block, you're guaranteed to get a block or nothing. Imagine that the pool administred by an allocator is 16B and the granularity is 1B with zero overhead (totally fine for our demonstration). You allocate eight times 2B. All is good. Then you deallocate every other allocation you got. All is good, there's 8B free. Yet, when you now try to allocate 4B, the allocation shall fail and you get nothing. It is THAT simple.
    7. Thanks, I have already figured out that the only way in OpenCL to transfer data from host to device is through function parameters. There is no analog of cudaMemcpyToSymbol in OpenCL.
    8. Current Project -Action/Adventure/Puzzle -Over the Shoulder/3rd person -Steampunk/Medieval aesthetic -Co-op (2 Player story line) Calling all content creators and programmers of any skill and experience level to join the team. Please be at least 16+ years of age. Artist(s) NEEDED (Unspecific; 3D Models, Concept Art, Animation, Ads, Graphic Design, ...)* *Artist(s), We currently do not have any art styles set. We are looking for an original artist to set the art style for our production. This is a big opportunity. Feel free to ask questions. I am super excited to get started and meet some new people. Comment or message me for Discord server invitation.
    9. In OpenCL you have 4 address spaces (OpenCL 1.1): __private - for every work item __local - for all work items inside work group __global - for all work items inside whole NDRange __constant - for global read-only variables In addition OpenCL 2.0 (pass in -cl-std=CL2.0 into clBuildProgram), which allows for variable in program scope and static variables to be declared in __global address space. They may be initialized with constant expressions only in code.
    10. hplus0603

      Pub/Sub for game Servers... Are you?

      I think you don't have enough experience yet to realize that, the more things change, the more they stay the same. Yes, Redis wasn't available in 2010. But, you know what? Redis can't magically do something that code written in 2010 couldn't. You had to do a little more yourself, but given the primitives available in Erlang, not a lot more. And the solution in Erlang scales horizontally with adding more nodes, whereas Redis does not (Redis Cluster is a joke, technically speaking.) (Yes, you can do application-level sharding for particular use cases.) If you have a specific kind of game that you want to build, with specific use cases and requirements that aren't met by existing technology, you may be on to something! If you're just trying to "build a system," without any kind of strong evolutionary pressure on the features and implementation of that system, then experience (not just mine!) says you won't build something that's all that useful. The reason is that many billions of dollars, and tens of thousands of man years are spent on networked games every year, and the market will already have explored most implementation nooks and crannies for the kinds of games that have already been generally funded and delivered. It doesn't matter if it's games, financial trading, car maintenance or movie production -- if there's already a large market, and you don't really have a very specific use case that's not currently served by the market, then you're quite likely not going to make something successful. Or to put it another way: Do things differently, is not particularly compelling and generally don't build successful projects. Do different things, is where it's possible to truly innovate and push the envelope of what's possible. And sometimes, you need to do things differently to be able to do the different things, but it's the different things that are the reason you win. That being said, building systems is fun and educational. As long as you learn the right lessons, and draw the right conclusions, testing a bunch of things and pushing them until they break is always a good way of gaining more experience. After all, good choices come from experience, and experience comes from bad choices 😄
    11. Lactose

      collision sprite

      Putting exit in code to debug is not something I would recommend. Research breakpoints and debugging.
    12. phil67rpg

      collision sprite

      ok I will work on it
    13. Rutin

      Card Game

      Great work on the card game. I tried all the modes and they work great. I like how you can select deck amounts and even the high card that will display. Awesome job!
    14. Renmazuit

      Composer Available

      Thank you.
    15. Hi I am trying to understand how Cities Skylines did grid alignment based on the curvature of the roads. Here is an image example: Cities Skylines: https://imgur.com/a/0PuykKT Whilst grids are generally easy to understand, having them not aligned to x:y:z is what i am am not sure of how its done. I can't find much resources on it, does any one have any guidance on this?
    16. DabbingTree

      Join my Ludum Dare team!

      I am joining a team for Ludum Dare 43, and I need a designer and an artist. We will use Unity3D for the game engine. https://crowdforge.io/jams/ludumdare/teams/2621
    17. Yesterday
    18. hi. im not sure that im asking it in right place but i think its a technical question. ten years ago making game was a very hard task. there was game studio, flash and.... but they were so limited. now every one is making games with unity. its a first solution on every game maker that has no tool. certainly still there are limitations on unity specially on platform-specific topics but unity is being updated with new tools and asset store is supporting special Utilities free or with low prices. there will be one question. will studios like naughty dog or santa-monica or Dice stick to their in-house engines or there will be time that they turn to such engines(specifically unity) for more simplicity and faster development. certainly study on specific hardware like ps4 or xbox can let you make better results about optimizations and quality but how much it is a priority. there are teams on these studios to always make new tools but can they be as good as and as fast as a company and a community that their job is to make tools?
    19. CyberFlash

      Y'all ever just get wayyyy to distracted time n time again?

      Hmm what DID you have in mind though? I like the idea of making an RPG, I'm just a bit stumped atm
    20. CyberFlash

      Getting back to it

      Nice! TIme to play some cards!!
    21. Gooey

      Y'all ever just get wayyyy to distracted time n time again?

      Nice house this has made me consider maybe making a 2d rpg next rather than whatever I had in my mind.
    22. Gooey

      Getting back to it

      @Rutin@CyberFlash if you take a peek at my newest blog entry the game is avaliable to download for win32
    23. Gooey

      Card Game

      After alot of messing about in windows I have finally sorted out the game for people to play in a .zip compiled for win32 any feedback is welcomed. If anyone is interested in a linux version this will be much easier for me CardGame.zip
    24. KaiserJohan

      Smooth normals and Tessellation

      Any pointers are much appreciated 🙂
    25. This article will introduce you to a range of introductory concepts used in artificial intelligence for games (or ‘Game AI’ for short) so that you can understand what tools are available for approaching your AI problems, how they work together, and how you might start to implement them in the language or engine of your choice. We’re going to assume you have a basic knowledge of video games, and some grasp on mathematical concepts like geometry, trigonometry, etc. Most code examples will be in pseudo-code, so no specific programming language knowledge should be required.
    26. I'm just curious how standard implementations of new and malloc() work. Do they use continuous memory allocation or something else? Because as you sad the memory could end up fragmented and we could arrive at the case where we have enough free memory but not a block (with continuous memory) big enough that we can use another new. In this case we would have to resort to some other implementation that does not use continuous memory and therefore not an O(1).
    27. Games live and die by performance, don't let yours conclude with the latter. See how Disc Jam* achieved fundamental performance and reached 60 fps on Intel® processor graphics using Unreal Engine* 4. Performance is a key focus for this project because maintaining 60 frames per second is an integral part of Disc Jam’s responsive and fluid gameplay style. As a result, we’ve learned a lot of lessons targeting this framerate using Unreal Engine* 4. Below, I discuss our experience working with integrated graphics processing units from Intel and how we ultimately achieved our performance target without raising our minimum system requirements. Read more
    28. Rutin

      collision sprite

      Okay. The solution to your problem is simple. Do what I posted above and run the animation sequence under your logic loop. Simply have a check that will see if plane.animationActive() == true then do what you need in there and update in the draw phase. The only thing your collision should be doing is setting the animation to active for the appropriate objects when collision is true, then you run your sequence under your logic step until it ends and set your animationActive to return false for that object. Your draw step will reflect which frames are active for each object. Apart from coding this for you, I have no other way which I can simplify the concept so hopefully you can figure it out. It's better to do things more logical as opposed to slapping together a band-aid approach when programming.
    29. In this 4 part series, explore important AI concepts and learn how to optimize for multi-core processors. Part 1 discussed ways to govern basic decision making for AI. In this 2nd part, the focus will be on giving AI context behind decisions. Part 1 discussed ways to govern the basic decisions that an intelligent agent-as artificial intelligence (AI) research refers to entities that use AI-may make. In this article, I give our hero (or monster or any type of game entity) some context to the decisions that will be made. Intelligent agents need to identify points of interest in the game world, then figure out how to get there. Finally, this article shows how to optimize these methods and provides ways of organizing them to account for multithreading. This article gets dangerously close to real artificial intelligence (AI). All intelligent agents need to have a basic ability to perceive their environment and some means of navigating and moving within the world around them-be it real or otherwise. Your entities will need to do the same, although with a much different approach. You can also cheat-which you will to make sure everything runs nice and fast. Read more
    30. Designing an adapting foil for a player that will match their moves and encourage growth is no simple task. In this 4 part series, explore important AI concepts and learn how to optimize for multi-core processors. Over the course of the last few decades, the gaming industry has seen great strides. Beginning with simple games like Pong* and Pac-Man* which offered players a short escape from reality and growing into such involved games like World of Warcraft* and Call of Duty 4* which are serious hobbies to those that play them. Today’s gamers, who according to the Entertainment Software Association (ESA) have an average of 13 years of gaming under their belt, have grown accustomed to seeing each new game become increasingly complex, engaging, and intelligent. For developers, the challenge becomes pushing the envelope to create games that are increasingly compelling. Computer-controlled Artificial Intelligence (AI) has evolved in many forms to meet the test. However, creating an adaptive foil for the player that can match their moves and encourage player growth is no simple task. Read more
    31. Allow the Intel® Test Suite to test your game's performance and playability on Intel® Core™ processors and Iris® Graphics. Stand out by getting your Plays Great on Intel® certification. Learn more
    32. Reaching your quality goals are important, which is why Intel® created the Plays Great on Intel® Program. This solution makes testing for bugs and improving game quality less exhausting. The Intel® Game Developer Program, is designed to help game developers at every stage along their journey. We are here to help you write highly optimized games that take advantage of Intel’s latest technology. To make a good game you need good Quality Assurance (QA) testing. Implementing a robust QA process is vital for releasing a problem-free game for your customers. However, QA testing is not a simple thing. Major bugs can be difficult to find and reproduce. Some only occur when certain conditions arise, difficult to observe, or not even 100% reproducible. It is impractical to test everything on every platform you intend to support. Efficient time management and comprehensive methodologies are required to get good coverage and reduce bug escapes. Learn more.
    33. Hello SillyCow nice to hear from you. Im excited to have won your interest for our project, you asked very good questions 🙂 I will answer your questions: 1. Yes, my intend is, that the game is free for everyone. At least one game (One opne slot) is always free to play a game. If you like to play more than one game, you can unlock other 4 slots for a small amont. We don't want to make money with this. 2. What do you mean with open source. I know the word, but i don't know how to bring it to open source. i think someone should have the complete overview and make decisions...but why not if you show us how it works ,-) 3. First stept is desktop game to test the game. If its work (where Im very sure), that we can think about a mobile version. 4. Off course multiplayer! And you can built alliances to play together. 5. No real time. Turn based. Turns depends on the players wishes. From 1 Day to 3 Days. But if all players send their orders, the turn end immediately, so it will be gone very fast in the beginning... 6. Definetely seperate game rooms with up to 25 or 40 players (We have to test this). We will have a command center with global chat. 7. Actually we are 1 Dev (28, Berlin), 1 art director (42) (Layouts), 1 grafik guy (46, Krefeld), 1 sound composer (25, Baku), 1 manager and game author (me, 44, Cologne). All freinds of me only the dev and the sound composer I knew about this game. We stay all in Germany (Cologne/ Berlin) The project is actually stopped for a while, because the dev can't do all the things by himself. We need one more dev who like this kind of games and will join us. We can talk about discord if you like, i can explain and show what we actually have. Best wishes, Cologny
    34. Hi everybody, Xilvan Design building 3D games since 2004 in Blitz3D, we now present you our kindly official gaming related pages. (please click on each links, download games & bookmark the pages): Lights of Dreams IV: Far Above the Clouds v9.47. Candy World II: Another Golden Bones v9.57. Candy Racing Cup: The Lillians Rallies v3.07. Candy World Adventures IV: The Mirages of Starfield v7.57. Candy to the Rescue IV: The Scepter of Thunders v7.27. Candy's Space Adventures: The Messages from the Lillians v17.57. Candy's Space Mysteries II: New Mission on the earth-likes Planets v7.57. New Xilvan Design Websites. Xilvan Design's Youtube Channel. Friendly, Alexandre L., Xilvan Design.
    35. Hi, The way I've implemented is by using two friction constraints separate of the contact constraint. (Each friction constraint is tangent to the contact normal, and perpendicular to the other friction constraint). The friction constraint must be clamped between the friction coefficient multiplied by the contact constraint impulse, and the negative of this value. The important thing to note here is that the friction constraint's clamping values depend on the contact constraint's impulse. That means each time you update the contact constraint, you must update the clamping values of the friction constraints before you iterate on them. It is possible you have already done this, but I don't see it in your code and you haven't explicitly mentioned it. Friction should work fine without warm starting, and you should definitely not need 50 iterations.
    36. phil67rpg

      collision sprite

      well to test my code I have the planes collide when I put an exit(0) in my collision detection algorithm it exits the screen. however when I put my drawcollision_one() function in the collision detection code it does not draw a collision sprite. thanks rutin. I am really trying to solve this problem. I am going to work on this problem more.
    37. I actually did not realize that the game is challenging until my playtester told me. Guess as the developer you just get used to it very fast. But I didn't want to change that as I am a fan of hard games. If you take your time with it the game becomes a lot easier.
    38. I gave it a few plays and wow it was hard!!! 😮 I didn't realize the farmers would be so mean... Those suckers chase you down. Then the motor bikes caught me off guard. I really like the shield too, saved my hide on several occasions. I gotta go out for a bit but when I come back I'll be playing more to see how high I can go. I'll post back if my score is worth showing haha! Nice work!
    39. Rutin

      collision sprite

      Since you're using time and not ticks the general idea is to set frames based on (x) time passed. Once your collision detection is true you would then activate your animation sequence. You then set the draw frame based on time passed, and you use that draw frame variable to determine which part of the texture to draw in your animation strip. I would suggest you do the following: Create an animation manager that can be used with any object with the following features. - Ability to set how max frames and time per frame in ms - Ability to set and check if the animation sequence is running - Ability to check on how much time has passed since the animation started - Ability to check which frame you're supposed to draw based on how much time has passed - Setting the offset amount to grab part of the texture in your animation strip based on the active frame - Ability to end the animation sequence once the final frame has been reached This is a basic outline and should be enough to get you started. Your problem is no longer a 'collision' problem, it's now "How do I create an animation sequence?". Also -- Based on your code, if you're putting the updated animation frame code in drawcollision_one(); how do you expect to see the result of the animation once the collision is done and it's no longer calling that function due to no collision happening anymore? If the bullet hits the plane and keeps going or is destroyed on impact it's no longer colliding, therefor you wont see the updated frames because drawcollision_one(); isn't calling. It makes more sense to check for collision, then toggle the animation sequence independent of actual collision happening again after the check...
    40. After coming up with the name Fusion for the ide, I decided to refactor the whole project to be called Fusion. So instead of vividengine, it's fusion engine. instead of vividscript, it's fusion script. Not just names, but major refactoring of class names etc. As for the newly titled fusionscript, I am half way through a complete rewrite of the parser. Also it now has reverse polish expressions, meaning they finally work like any other language.
    41. phil67rpg

      collision sprite

      I am trying to toggle the animation sequence upon collision but it does not work for some reason, it looks like it should work.
    42. A new entry in the devlog for 13 Ronin, a retro 2d samurai fighting game, this time it's about implementing the logic for the computer player. Happy coding! https://www.eraserheadstudio.com
    43. Like legit though! I got that recent Humble Bundle deal with all them pretty pictures and things and I'm just in RPG mode right now 🤣 I usually live stream some video games like Destiny or Dark Souls or whatever but I even abandoned that and spent 5 hours messing around with some new assets. Still streamed though, just of pc instead of ps4.. That's the important bit. I'm liking the attempt of an RPG because I don't know how to do it 100%.. Like a tower defense or space shooter or platformer, i've done those many times over.. I spent maybe 2 hours figuring out why my collision box wasn't triggering on a wall piece and preventing movement. Got it in the end though! That's also the important bit. Being able to figure it out. I'd hate to just watch a tutorial and follow it and be done with it like now I know things that I technically should have already known like the size of my sprite really matters because obviously my bounding box + my collision range is what's used. And I knew the second part but any other tutorials that may have been followed back in the day, they've got their sprites sorted so you just import sprPlayer and its already the right size... I'd have never got that little piece of information by just blinding following a tutorial. Plus I'd never wanna release anything for 'me' if it was made solely with a tutorial. But yeah, my tower defense is still waiting on a few pieces so that's just in limbo right now, The space shooter got paused due to getting all these assets so I'm now messing around with RPG stuff and there's fairly 'simple' things that would just be the same as other games anyway, like moving to a room, the code/command for that is obviously the same and you just alter the condition. Ding! Winner! lol but yeah I feel like I'm making a 'proper' game when I'm spending a really long time making a level knowing full well I've got to spend many many more hours on all the other levels. I'm basing my thought process there on the fact that I've mostly just been making games that run themselves once you've built the first part. Tower Defense that never ends (with 1 map/level), Space Shooter that infinitely Scrolls and/or Big Space Boss fight type stuff.. Although, I am on the hunt for a 'proper' solid wall collision method as I think several thousand objects called objSolid or objWall or objWhatever is ultimately going to slow the game/break stuff? I mean games can have like thousands if not millions of things in them though maybe? I'm just worried that I'm going to end up spending 10+ hours placing down thousands of objects and adjusting them and testing them and then find out that you can just use code like ""blah blah billy bob wrote this"" and that will check the type of tile or something you know? I was reading one method where someone talked about making a type of an array made as a grid for your entire map/screen that counted (and then destroyed) each instance of your wall and gave the wall tiles on the grid a value of 1 so you'd not have to worry about thousands of objects cluttering the place BUT you still need to insert them and test them... I'm thinking that is just 'a part of the process' though really. Like I don't want to take lots of shortcuts, I'm just currently not in the mindframe of spending hours doing 1 task like adding all the wall objects on top of the soon to be 'wall tiles' so I think a bit of personal adjustment is required really. I just want to make sure that this is what people really do. If it is then I'd be happy to just get on with it... Heh, look at that! Attempting to join the level designer guild which reminds me. I need to go learn how to make 'cool levels' in an RPG!!! I can make a house but where does it go? Hmmmm
    44. ERASERHEAD STUDIO

      13 RONIN - DevLog #7 - Fight or flight!

      Since I had no previous experience of coding a computer player I turned to our friend google for advice. I found a number of threads on the subject, some talked about AI, but most of them talked about reaction based solutions, but since I’m not interested in AI and rather want to mimic the feeling found in old-school fighting games I decided to go for the reaction based solution. And when I use the phrase “reaction based”, I’m referring to an implementation that selects action-based on one or several conditions e.g. if the opponent hit then block. Feeling a bit over-confident, I stopped reading and headed over to Visual Studio just to realize that this was not as easy as I had thought. Soon I had a bunch of if-statement and a code hard to follow. I refactored the code, but still I wasn’t pleased Along came Halloween and at my workplace, we had an amazing party (I was dressed as the Invisible Man). After dinner, I chatted with a colleague and talking about the computer player he asked if I was using a decision-tree for action selection. Decision trees? What’s this, yet another gap of knowledge. The name itself told me that this was something I had to read up on. So, the day after, still recovering from the party, I started reading. And oh yes, this was what I’ve been looking for. (Thanks Mikael for the suggestion) Decision trees The full definition is somewhat longer, but simplified, a decision tree is a tree structure describing conditions and results. Every node is a condition deciding upon which branch to follow until reaching the leaf and the result of the path taken. This was exactly the kind of data structure I needed to find a structure around the computer player logic Using a fluent builder I could put all conditions in a tree and let the leaves contain what actions to perform. Decision tree for the computer player. DecisionTreeNode My implementation of the decision tree is very basic, it consists of a DecisionTreeNode-class that I use for the tree as well as for the nodes and the leaves. The Condition-property is only applicable to condition nodes. It’s a delegate that when called will evaluate what child node to step into. It returns the name of the child to step into. The Result-property is only applicable to leaves. It’s a delegate with actions associated to the leaf. The GamePlayState-class contains all data needed when deciding computer action. DecisionTreeBuilder I’m quite fond of fluent coding so when building the DecisionTreeBuilder it was a natural pattern to choose. Using this pattern makes classes easy to use and code easy to read. This is how I build the decision tree var decisionTree = DecisionTreeBuilder .Begin( "Reacting", state => state.Player.IsReacting() ? "Elapsed" : "Opp new action") .AddNode( "Elapsed", state => state.Player.IsTimeToReact(state.GameTime.TotalGameTime) ? "Facing" : "Done 1") .AddNode( "Facing", state => { return state.Player.IsFacingOpponent() ? "Reachable 1" : "Reachable 2"; }) .AddNode( "Reachable 1", state => state.Player.IsWithinReach(state.Opponent) ? "Opp attacking" : "Opp approaching") .AddNode( "Opp attacking", state => state.Player.ActionToReactUpon is AttackAction ? "Defend" : "Attack 1") .AddLeaf( "Defend", state => { state.Player.ResetReaction(); state.Player.ParryHeadCut(); }) .AddLeaf( "Attack 1", state => { state.Player.ResetReaction(); state.Player.HeadCut(); }) .Parent() .AddNode( "Opp approaching", state => state.Opponent.IsAdvancing() && state.Opponent.IsFacingOpponent() ? "Idle 1" : "Advance 1") . . . .Build(); AddNode will create and append a new node to the current nodes’ children and then go into the newly created node and make it current. AddLeaf will create and append a new leaf, but not go into it. Parent will go to the parent node and make it current. Build will return the newly composed tree. The choice to use strings for names makes it easy to follow the code but also makes it easy switching between the diagram and the code. The Parent-, and Name-properties together with the GetFullName method make nice tools while debugging. Player In my game I have a HumanPlayer-class and a ComputerPlayer-class, both implementing an abstract class Player. The main difference between the Human- and the ComputerPlayer-class is how the Update-method is implemented. The HumanPlayer-class is using input from keyboard and gamepad to control the player character while the ComputerPlayer is using the decision tree. The code for using the tree looks like this: var leaf = _decisionTree.Evaluate(state); leaf.Action(state); Nice, isn’t it? Happy coding! jan.
    45. Septopus

      Pub/Sub for game Servers... Are you?

      @Hodgman I think I'm making some more sense out of your link today.. still not sure, but I think you're trying to say that I should be weary of the overhead I'm creating.. Make sure that my solutions aren't creating more problems.. that kind of thing.. Gotcha. I think I'm smelling your fire. I get that any change from a "single threaded" approach to anything WILL add overhead. I've accepted that fact. I'm designing my system without a "central simulation" because the overhead of splitting that kind of mechanism into many different parts would be almost impossible for me to engineer around. Instead of the single central simulation, there will be many nodes on the network that can interact with players in real-time. The clients will be the physics processors and collision detectors. The servers will orchestrate synchronizing the interactions between game entities and make corrections to game entities that risk breaking the illusion of multi-player interactions. My game/system is a different kind of thing. I'm not just trying to mimic or improve on existing systems/methods, I'm trying to engineer a different one. And I'm probably a bit naive in some of my approaches, and that's fine too, because I'm learning lots, and it doesn't take me long to re-gear when things don't test out the way I'd like.
    46. I am planning to buy a copy of the above book. However, all the available copies do not have the companion cd. Can anybody advise me if I definitely need the companion cd or will I be ok with just the book. If I definitely need the companion cd, can anybody advise me where I can get a copy of the companion cd for this book. Thanks.
    47. Looks like no. write_imagei black screen
    48. Znippy

      Frogger

      Album for Frogger
    49. Znippy

      GameDev Challenge - Frogger - Part 4 (Final)

      Final build is uploaded now!
    50. Znippy

      Frogger Challenge Entry

      Awesome submission! Gameplay is really smooth and the retro look is perfect! I really like the perspective with the mixed 2D/3D look. Sound effects sound like they were made with bfxr? Used the same tool for my project.
    51. Zakwayda

      tile based RPG movement Animation

      I think the easiest answer is that whether movement should be tile-based or 'free' is entirely up to you. Either approach may have both advantages and disadvantages, depending on the circumstances, but as you note, you can have free movement and still use a grid for level design and pathfinding and so on. I think you could probably solve the differing speed problem even with grid-based motion. But, it sounds like free motion is really what you want. That may introduce some additional complexity (for example, you might have to handle collision detection and response differently than with grid-based motion), but it shouldn't be anything insurmountable.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!