Jump to content
  • Advertisement

Postie

Member
  • Content count

    324
  • Joined

  • Last visited

Community Reputation

1559 Excellent

About Postie

  • Rank
    Member

Personal Information

  1. Postie

    My First Game (Please Don't Judge Me)

    Not bad. The biggest issue I see is not providing the player feedback on certain game events. For example, when the player or enemies take damage. Because the game is about dodging, it is not immediately obvious if you were hit or managed to get away. You could briefly flash the player red or play an appropriate sound effect (or both). Another suggestion I have is to add inertia to the player's avatar. So instead of just updating the x,y positions of the player when you hold down the movement keys, you use an acceleration vector to adjust the player's velocity and apply a dampening effect when no keys are held to bring the player to a stop. This can be quite effective in making the controls seem smoother, just don't over do it :).
  2. Your calculations seem correct. Definitely sub-optimal, but ok for a "reference" implementation as you mentioned. I think the problem is with the final step where it converts the distance data to the bitmap for visualisation. Your technique scales the entire distance field based on the maximum and minimum distances.  I've found that clamping the values to a certain range produces better results. For SDF's the important information is generally around 0, so I kept my distance values to the range (-64 to 64 pixels), anything higher or lower is clamped. Then you map that range of distances to your grayscale. Another thing I just thought of, is that your algorithm may not permit a minimum range of 0, since its always looking for texels that are opposite to the current one. Therefore the minimum distance may always be 1, which would explain the discontinuity as the gradient would go directly from -1 to 1.
  3. Postie

    ECS and saving/loading

      That's pretty much what I was saying. Serialise the properties that are dynamic. Assume the properties that are static.   For a more concrete example, I had an "EdibleComponent", which was given to entities that could be eaten. I also had an "EdibleComponentTemplate", which defined the food and water values you'd get from eating it. These values are static, so I didn't serialise them. The edible item can spoil over time, so there was an Age property in the EdibleComponent which ticks at different rates depending on how it is stored (refrigerated vs not etc). Since that property is dynamic, it is serialised.    So a mocked up example of how the serialised file might look:   The entity template: Name = core.entities.redberries <Edible>     FoodValue = 15     WaterValue = 20 </Edible> Serialised Entity: Template = core.entities.redberries <Edible>     Age = 123 </Edible> Obviously these can be stored in whatever format you like, this is just in text for clarity. You can replicate the properties from the template in the component or have the component reference the template. Eg:   entity.GetComponent<EdibleComponent>().Template.FoodValue; vs entity.GetComponent<EdibleComponent>().FoodValue; I prefer the former as it makes it easier to tell which properties you should be serialising in the EdibleComponent class. Hint: everything! :) In the latter you have to remember which is which.
  4. Postie

    ECS and saving/loading

    I've previously tackled this by having components and "component templates". Think of component templates as the properties of an component that do not change during the course of the game. For example, how much health a power up gives, or the dexterity requirement of a weapon. The component templates are bundled together into an entity template with a unique identifier.   When instantiating an entity, you pass in the entity template and create each of the components it requires, using the relevant component template.   Then, on serialisation you only serialise the dynamic properties defined in each component. Eg: transform, current health value etc. None of the properties in the component template can change, so there's no need to serialise these. But what you do need to know is which entity template was used to create the entity. So, you also store the unique identifier for the entity  template. On deserialisation you read the entity template identifier, instantiate a new entity exactly as it was orignally spawned, and then deserialise the components' properties into it.   A note on unique identifiers: I found using a string ID that resembles a namespace was much more flexible and robust than using an integer. For example: "core.entities.longsword" rather than "123".    It's easy to assign meaningful id's and also handy if you want to offer content expansions or themed content. In my example, I used "core." to represent the core (always included content), and you could use "halloween." to include content that should only exist if the game is played during halloween. Enabling/disabling this content at runtime is then trivial.   I also wanted to support modding, and having a namespace like structure makes id collisions almost impossible. Eg: "mods.mikesweaponsmod.rifle" vs "Id = 4567". How likely is it that a mod creator is going to be able to guarantee the Integer Id's they've picked can never conflict with other mods?    In addition, a saved game may reference entity templates that are defined in a mod that is no longer installed, and you have a much better chance of handling the situation gracefully if the templates are identified by a string rather than an Id. eg: missing entity : "Id = 1234" vs missing entity : "mods.extratrees.birch".  
  5. Postie

    Any good A* tutorial?

      +1 for Amit's tutorial. One of his strengths is visualising algorithms, and his A* tutorial is great. 
  6. Postie

    Planning on using Blender

    Well, I just learnt something new. Thanks! :D
  7. This behaviour looks a lot like something I was dealing with myself about a month ago. If the joint rotation's origin isn't correct, the vertices of the mesh stretch rather than rotate around a common point. In my case it was due to how I was composing the final Translation Matrix for the bone.   The bone has a bind pose translation matrix and I needed to apply the desired local rotation. For it to work correctly I had to decompose the bind pose translation matrix into separate Rotation and Translation matrices and apply the local Rotation in between the two.   Eg: If the Bind Pose translation matrix is made up of R x T, and the desired local rotation is Y, the final transform needed to be R x Y x T, not Y x (R x T) or (R x T) x Y.    It's confusing, because none of the sources I consulted mentioned the need for anything like this, but without it, I couldn't get it to work properly.
  8. Postie

    Does our icon suck? - brutal honesty required

    In my opinion the biggest issue is the eyes. He's not quite looking directly at us, but he's not really looking away either. It's a little weird.
  9. Postie

    Should I start with game making tutorials

    I'd recommend the tutorial based approach at least initially, to give you something to start from. Starting from scratch without guidance can quickly lead to frustration.   Once you're comfortable with what you've learnt, by all means go "off script" and try things out on your own! :)
  10.   Heheh. I remember when I made that exact statement about my game project almost 5 years ago. I also remember 6 months ago when I suddenly realised why it was a bad idea and spent a few months refactoring everything to remove all globals.   Globals are seductive because they are easy to use and let you share information between different objects very easily. But you eventually end up in dependency hell, where to test a small system you need to recreate the entire game state, since object A references systems B and C, and they rely on D and E and F.. etc   The best thing about the mindset of passing dependencies instead of referencing them through globals, is that poor design stands out like a sore thumb.
  11. Postie

    Code quality at work

    We've adopted new methodologies at work which I've carried over to my hobby projects, and similarly I've used hobby projects to learn new ideas that I've then suggested we adopt at work. There's more formality in place at my work, eg: Continuous Integration, Gated Checkins, the occasional code review, but there's not a "Work" and "Home" version of me as a developer, there's just me. :)
  12. I struggled with Raknet for a few hours just trying to get it building. At the suggestion of a friend I ditched it in favour of Lidgren. It was easy to use and I was up and running with simple client/server comms in no time, so I'd definitely recommend Lidgren over Raknet. I recently discovered that Lidgren has a nuget package which makes getting access to it even easier than the github way if you don't need the source code. 
  13. If you're not doing console game quality, it opens up the floor a bit more, so alternatives to c++ become viable. I'm working on a game project at the moment which is a mixture of C# and Lua.   To answer your question, the "best language to use" is probably going to be whatever language *you* are most proficient in that has a Lua implementation. 
  14. Postie

    You Don't Need to Hide Your Source Code

    I think there are other ways to "give back to the community" than handing over your entire source code. Adding modding capability into your game and then letting your community run with that still ensures you have ultimate control over the game, but your fans are free to go in interesting other directions if they like.   Since I used Infiniminer as an example in my previous post, it seems fitting that I use Minecraft as an example of a well thought out modding strategy. Initially, Minecraft didn't support modding, but some clever fans figured out how to inject some code into the game that would allow them to tweak things and create some crude mods. Rather than shut that down completely, Mojang engaged with the community and built a rich modding capability into the game engine itself. 
  15. Postie

    You Don't Need to Hide Your Source Code

    You mentioned MineTest, (a Minecraft clone), which reminded me of the story of Infiniminer, the game which inspired Notch to make Minecraft as we know it today.   Infiniminer was primarily multiplayer, and a month after release the source code leaked. Players took it upon themselves to make little balancing mods to the game and re-released them so others could also play. Community-involved development. Great huh? Well, no. The mods made the binaries incompatible with each other, so the once singular community fractured into many sub-communities that preferred certain gameplay.    Realising he couldn't put the genie back in the bottle, the developer gave up on it and moved on to other projects, which effectively gave Notch the greenlight to make Minecraft. Which is a positive I guess, but losing control of your project is a real risk.
  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!