• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Ricardo3Ddev
      Hi guys!
      This is a independent game being produced by me and my brother. We’ve been working on it for about 6 months and we’ve already done a good part of the game. We hope to finalize and make it available on Steam by the end of this year.
      We are using Blender 3D and Gimp software for production.
       
      About the Game: Dongo Adventure will be a 3D platform style game, where the main character (Dongo) is a mouse that ventures through various scenarios (sewers, culverts, streets, electric grid, etc.) and faces several enemies along the way (cockroaches, mosquitoes, spiders, toxic gases, electrical wires, etc.). He carries a basket / backpack with cheeses that he uses to throw and defend himself from enemies, as well as being able to push objects that helps him to overcome obstacles. The ultimate goal will be a surprise!
       
      Now we are developing new scenarios and enemies. We hope to publish news soon...
      Game page on Steam: http://store.steampowered.com/app/811450/Dongo_Adventure/ - (Teaser UPDATED)
      Dongo Adventure - Indie Game Project (First Teaser) https://www.youtube.com/watch?v=X2nmxtkE0xk
       
      Thanks for following the project!

    • By iradicator
      This is a general question about player controller on a surface that contains geometry (curved roads / slopes, mountains, etc.) and obstacles (walls). The game should simulate a simple physical model (acceleration, collisions, etc.) and the character should navigate convincingly through the terrain. 

      I'm using Unity but I think this is a general question about how to design a character controller.

      I wrote a simple character controller that uses player input to steer the character in the world. wasd keys move forward and turn. Since I'm controlling the character directly, I'm using a kinematic object (I don't even use the rigidbody) and moves it by setting the transform directly to some model I implemented (I have speed, acceleration, mass, etc.)

      Why did I wrote a physical kinematic simulation? I tried to use a rigidbody and apply forces based on player's input directly on it but I found the control felt a little bit "swimmy" and it was hard to tweak (example: the character slammed hard and spun out of control (even when locking xz rotating direction), it took a long time to accelerate, etc.)

      That worked well when during prototyping on a simple plane with no obstacles. Now I have a level with non-even geometry. The problem I have is how to make the players "stick" to the ground when they travel around (Prototype applies movement on the xz plane but doesn't take into account being connected to the floor). Another issue is to set the orientation (up vector) of the player (imagine a vehicle) in a way that looks both smooth and convincing - the vehicle should change its pitch / roll as it's navigating through some slopes. Even the simple example of a  vehicle starting to climb from a plane on a road with a constant slop (say 20 deg) should change the orientation in a convincing manner, i.e. the vehicle should not start to "lift the nose" before touching the ramp, nor should it "sink the nose" colliding into the ramp. Again, this is where the physical engine can come in handy, but when I tried to apply force going up the vehicle slowed down because of friction.

      I also have problems with collisions since I'm moving the character directly by controlling its transform (kinematic), it feels weird and doesn't play well when the physics engine detects collisions and doesn't want to let the character penetrate a wall. It collides well with objects, it just feel very not natural.

      The real questions here are about best approaches to design a character controller (note: that SHOULD be applied also to agents using AI steering algorithms - that also calculates forces or running a model underneath). 

      1. How do you move a character? Are you using the physics engine to do the heavy lifting or you control the character directly like a kinematic object?
      2. If you're using physics, what's the best approach to apply forces? (yes, it depends on the game, but let's say some realistic based physics model with accelerations and forces - let's assume animations don't apply root motion - to simplify) In Unity, there are multiple ways to apply force - relative / non-relative, impulse / continuous etc.
      3, If you're not using physics, how do you make sure that collision detection play nice with your movement algorithms? How do you make collisions look natural and still give the player good control?
      4. Uneven terrain, how do you make the character (let's assume a vehicle - a car - with no complex animations (so no IK in play)) "stick" to the ground while changing its orientation (up vector) in a smooth and convincing manner?
      5. what's the best way to also allow the player to disconnect from the ground? (e.g. either jump or fall off platforms)

      For me, rigidbody vs. kinematic is the key question here. I saw tutorials that use both - but since they were super simple they didn't deal with the problems I mentioned above in depth. I'm wondering what's the best approach for the player controller and would love to hear more points to consider and tips based on your experience. Pseudo code / code samples (in any language / engine) would be much appreciated. Thank you!
    • By Monty Kiani
      This idea comes from the concept of making a game that specifically, fills the time of a person in travel when the person might not enjoy the adrenaline factor that accompanies many games.  I couldn't come up with anything so I thought about the general vibe I wanted and an action people did in general that emulated that. I found that it mostly happened, amongst other places no doubt, when people go through their messages panel on their devices; a plane traveler/businessperson perfectly calm for a minute eliminating messages, that moment extended. It's a kind of process of elimination. I don't know if this idea is common knowledge but I couldn't find anything and I'd love to see games based on this. 
    • By Jack Slink
      today i've finished working on PNR alpha and sharing it with you guys. main reason for sharing in this early stage of development, is to get feedback about what you'd like to see in it in the future etc. 
       
      link: https://katabunaga.itch.io/pnr-alpha-v010

    • By CrazyApplesStudio
      Hello,
       I managed to finish my first Android Game from A-Z in about 2 months, the game was planed to be an endless game since as a solo Dev i thought it would be easier to finish , it was created using Unity/blender3d and i made everything except for the music tracks.
       Currently i am looking for feedback, especially about mechanics and game play, especially since i found out this is the hardest thing while developing as and indie , i seem to be able to get 0 feedback from most communities i posted in so i hope i will have more luck here.
      A short game play trailer:
       
      The game is Free and available on Google Play Store:
      https://play.google.com/store/apps/details?id=com.CrazyApplesStudio.ApplesMania
      So feel free to comment , critiques are appreciated, even if they are harsh, since that is what will help me improve the game.
      Also the website for the project : http://crazyapplesstudio.com/
      Twitter: https://twitter.com/ApplesStudio
      Facebook: https://www.facebook.com/ApplesManiaX/
       
  • Advertisement
  • Advertisement

Gameplay Trying to figure out a flexible solution to a "loot database"

Recommended Posts

So I am building a mix of a 2d survival / action rpg (more towards the action rpg) and something that I am going to need to be able to keep track of is loot. I am going to have hundreds of base items I need to keep track of and then also each "entity" that can drop items will have a loot table of what items it can drop that I need to keep track of and I am trying to figure out an efficent way of doing this. I have an initial idea but what to get input on it.

NOTE: I am doing this in C# (Unity to be more specific).

I want to have 1 main class that would store an array of all possible items that can drop which would probably be read in from some sort of data file. Each of these items would have a unique string identifier so I would want to also store a dictionary<string, int> which would allow to easy access to the item by the identifier like this:

Item item = Items[itemDictionary[id]];

I assume this would be more efficent than using a List and doing something like filtering especically if the list of items gets really large.

Then each entity would have an array of all the possible items it can drop by storing the string identifiers. Then when the entity needs to drop a piece of loot, I can just pick a random index from that array which will lead me to the item from the main class storing all the items to know which item to drop.

Obviously this is a very high level overview of what I am think of implementing and I am sure as I expand thing, stuff might have to change but as a general concept, anyone have any feedback on this?

Share this post


Link to post
Share on other sites
Advertisement

Don't use strings. Use ID numbers instead.

If you need to look up the string name of an item from its ID number, just index into a List<Item> using that ID, and pull the string off the Item itself - this is a constant time O(1) lookup instead of a hashmap lookup and string compare. If you want to go from string to ID, store a secondary dictionary, but be disciplined about moving to ID numbers as soon as practical in code, so you do fewer string operations.

This is pretty much how the Guild Wars 2 item data works, for example.

Share this post


Link to post
Share on other sites
1 hour ago, ApochPiQ said:

Don't use strings. Use ID numbers instead.

If you need to look up the string name of an item from its ID number, just index into a List<Item> using that ID, and pull the string off the Item itself - this is a constant time O(1) lookup instead of a hashmap lookup and string compare. If you want to go from string to ID, store a secondary dictionary, but be disciplined about moving to ID numbers as soon as practical in code, so you do fewer string operations.

This is pretty much how the Guild Wars 2 item data works, for example.

I second this! I've worked on a few RPGs, and this is pretty standard. This is why you will see LOOT ID TABLES when modding certain RPG games. It's way easier to track, and find when you do it this way. Stay away from searching by STRING.

Share this post


Link to post
Share on other sites

Well, you could use enum values, but only if you're okay with the tokens potentially becoming incorrect or else being vague like WEAPON_AXE_2.

Honestly there probably aren't many cases where you need to refer to a specific weapon type rather than just a variable with an ID in it. If you like you could just write something to look up the ID by name like Apoch said, but you're going to pay some perf cost for it, so you really don't want to make it common.

Edited by Khatharr

Share this post


Link to post
Share on other sites

So also, realize that what the game uses while running can be different than what the programmer/level designer/content creator/modder uses while creating.

It would be quite normal to have some form of (possibly partial) mapping of strings to IDs for items.

So let's start with the assumption that the game itself uses IDs for all of the game objects, including object templates (which is pretty much what an "item type" is.  We'll assume these are integers (16, 32,or 64 bit depending on scale and computer arch).

Now we can then assume that there can exist a map table of unique tokens or names, which references this ID, which can be used by modders, designers, with a simple call to a method like:  

int ItemTable.LookupIDByToken(string itemToken);

and you can optionally add overloads to 1 or more other methods that accept an item ID, to accept an itemToken and perform the lookup for you.  Even more than that, you can create a rule that the token/name of an item cannot start with a numeric character, and therefore any string which contains a number in the first character can be assumed to already be an item token ... so if a modder passes a string to a method expecting a token, that lookup method can simple do a super fact 1 character check, and then parse the string without any lookup at all.

And this is the trick that then allows you to use only a partial map table and not require all items have names.  Say you have a database with 4000 items, all of them can be easily referenced by ID (if it is known) .. but you could have a much shorter list of perhaps 300 common items, and maybe 50 "special" items that modders / designers could use for the 95% of them time they are just doing something simple putting a chest with a cache of money in a chest, with an options health potion or whatever.

Also, this technique of "first letter (or prefix) denotes how to interpret the token" can be built upon in the future.  So say you start with the ID that numbers are object, but maybe only tokens starting with "I..." are items, then later you can add simple routing to support passing through "S..." elements which may be skills, or "X.." loot which may be experience. etc.

Share this post


Link to post
Share on other sites
2 hours ago, 3dmodelerguy said:

I guess my though process behind using a string is that it is recognizable and rememberable, it is easy to know what "WOODEN_AXE" is but not 173. 

To be honest, I just had an excel sheet on the other screen referencing all the IDs while coding. I wouldn't over think this, just use IDs for your items, and keep a reference guide some where. This is just how I personally did this prior.

Share this post


Link to post
Share on other sites

What I use for an endless runner project is some kind of UUID struct that is wrapping arround a long value using an encoding function to Base34 (like Bitcoins Base58 encoding but with only capital letters and digits). So what I get is the 8 bytes unique ID in the background covered by a string like '6NYTP5QEJQDV9' for example. It may not be something very readable but it works as expected.

This string ID then is indicating the so named scene for streaming the level parts into the game while running. This fits the above suggestions so may be fine to use.

What you also could do is to write some kind of custom inspector or tool for unity to get editing of your items more user friendly storing anything into a ScriptableObject inheriting class as your master item database. This is how we do it in nearly any of our unity projects

Share this post


Link to post
Share on other sites
On 7/6/2017 at 8:37 PM, Rutin said:

To be honest, I just had an excel sheet on the other screen referencing all the IDs while coding. I wouldn't over think this, just use IDs for your items, and keep a reference guide some where. This is just how I personally did this prior.

Rutin's answer is how Bethesda handles this with the fallout and skyrim engines ... just loot at:  http://www.ign.com/wikis/fallout-3/Item_Codes for an example. Everything's "item id" is just a 32 bit integer, which they write as 8 HEX digits (0-9 or A-F) so that you can recognize they are a game id at a glance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement