Moderators

132

13777

Moderators

111

14287

Moderators

100

10745

Moderators

59

8275

Popular Content

Showing content with the highest reputation since 06/24/17 in all areas

1. 13 points

2. 9 points

Water

So, I ended up doing the "skirts" method I spoke of in the last post. And in conjunction with the default Urho3D water shader (with a few small tweaks, and more to come to eliminate artifacts on the corners of the water blocks) it actually looks pretty decent. The water animates a noise texture that ripples the ground beneath. It also uses a reflection texture (which I have set to black at the moment) if desired. I might tweak the water shader further, but for now I'm happy with it. I've also got all the small issues sorted out from the change to multi-level water. It wasn't a large change, but I was surprised at how many different parts of the code worked from the assumption that water was determined by elevation < 9. I thought I had contained it better than that, but I did get all the various spellcasting, pathfinding and object spawning oddities worked out.
3. 7 points

Do I really need a server to prevent cheating and ensure state consistency in simple games?

You're misunderstanding the nature of cheating - you can only do a client rollback if that client accepts that it needs to rollback (which a cheater's client typically will not), or if you know that it's cheating (which a cheater's client typically will not broadcast). The client is in the hands of the enemy and it can be tampered with or modified to do whatever the user wants. Expecting a client to self-correct cheating is like expecting prisoners to lock themselves in their cells. Practically, a game developer has 2 choices to prevent cheating: A central server maintains the authoritative state, and prevents cheating because all game state changes must be accepted by the server by definition. This is a typical client-server game. All players maintain an essentially identical state, and prevent cheating by ensuring that they all agree on what the state is, and reject players who disagree with the majority. This is sometimes called 'deterministic lockstep' or some variation. Your game type will not scale to the second solution, so you need the first.
4. 7 points

How good is Urho3D ?

I find Urho3D to be fantastic. I'm using it to make my game, a turn-based, hex-based RPG hack and slash: It's a very solid engine, lots of support on various platforms and quite capable.
5. 7 points

6. 7 points

A correct way of writing this?

A derived class can never renege on features provided by the base class; doing so is an violation of OO's LSP rule, so this approach is invalid. OO would force you to use composition instead of inheritance here. Make your own class from scratch which contains a vector within the private implementation details.
7. 6 points

8. 6 points

C vs C++, Objected Oriented Programming vs Data Oriented Programming

In terms of getting into the traditional industry, you need to be comfortable with object-oriented programming in C++. There's no serious debate there. The major engines are object-oriented, most in-house engines are object-oriented. There's a whole continuum of just how much inheritance you might see, but on the whole you are not likely to run into C-style data-first engines. This does not mean that you have to make a binary choice. You will need to be comfortable with object oriented programming but a good knowledge of data-oriented programming can help you if you want to optimise very low-level things, or if you end up working for a company that favours that sort of approach. A lot of data-oriented design is typically based around the reductionist view that programs are essentially just processes that transform data, and therefore you should just structure the functionality around the data, both to better represent the process and to help the computer perform this process more quickly. This view holds very true for certain low-level operations that operate on batches of similar objects, such as rendering or physics, but is barely workable for many high-level operations, such as AI or game logic. An effective engine will therefore often feature a bit of both; heavily data-oriented code at the low level for maximum performance, and heavily object-oriented code at the high level for maximum expressiveness. There's no need to throw out object-orientation entirely just because it may not be best route to top performance for certain tasks. That was 18 years ago. Probably 20 years if you are counting when development started! Ignore this particular part of your research.
9. 6 points

New Gameplay Video

I'm on vacation in California, which means I kinda have some time to work on stuff, but it's split up by blocks of frantic activity. I'll tweak a few things, then head off to Knott's Berry Farm to burn in the sun while the kids ride on rides too small for me. Then I'll fiddle a few more things, then take the kids swimming. So while I'm getting some stuff done, it's all in a sort of disorganized tangle. I did decide to upload a new gameplay video. Once again, it's pretty poor quality. (Some day, I'll own a rig decent enough to make high-quality videos. But that day is not today.) It's about 10 minutes of random gameplay. I was kinda distracted while playing by a 5 year old who wanted my help building electronic circuits with a snap kit toy he recently got, so there are some pauses. Also, there is still stuttering in some spots, which won't be cured until I fully convert everything from Lua to C++. (That's an ongoing project, but I am getting quite a bit of progress done while here in Cali.) The stuttering is from the Lua garbage collector, which has been an ongoing problem with the Lua bindings to Urho3D. Throughout development of this game it has been at time worse and at times better. A recent change (unsure which one) made it worse again, enough that I'm finally going to just convert everything except UI stuff to C++ components.
10. 6 points

11. 6 points

Stop hacking

One thing you can do is try to run as much of the game logic as you can on the server side. You can't really trust the data clients give to the server, since they can mess with that data, then pass it to the server. Examples might be telling the server where they are (even if they are not really at that location), or how much health they have left, etc.
12. 5 points

It has to be the same mutex. Otherwise they're not interacting in any way to prevent the other thread from accessing the queue. The point of a mutex is that it is shared, like the thing it is protecting, different threads must acquire it before proceeding to use the protected resource, and only one thread can hold it at once. The other threads will block if they try to access the mutex, until the mutex is freed up by whichever thread acquired it. This means only one thread can access the resource at once - which is the intended behaviour. There are some esoteric situations where people use multiple mutexes for various functionality but that is not the usual situation.
13. 5 points

Just published my first game. Any advice?

You can definitely improve the background image and main menu. When I clicked your link I initially thought it was a popup ad and instinctively added it to my adblock blacklist before I realised it was the game. Other than that, I would be interested in playing this game with the player speed slowed way down, such that you actually can make decisions for both snakes within 2-3 frames of time. As it stands now, the strategy is to make the top one a bit longer, then put it on autopilot and focus all of your attention on the other one, etc. My idea would be Slow down snek speed so you can focus on both Remove wrap around feature so you have to focus on both (add borders)
14. 5 points

Storing hashes as game states

Hashes, Databases, Sockets, States... These are all *completely unrelated things*. I'm worried that you're misusing terminology. Can you clarify your question by describing what you think those terms mean so that we don't misunderstand what you're trying to ask? Hashes are a lossy conversion of data. You can't get the original data back. So, no, you should not use them to store game states. You can use them to quickly FIND game states, but you should not use a hash for the state itself.
15. 5 points

Multi-level Water

So, I'm trying to figure out how to do water. Right now, I am doing water the "brain dead" way; any tile below a certain height is water, and water is created as a simple hexagonal plane with a partially transparent blue material applied. It works okay, but the ultimate end goal is to have water play a more involved role in the landscape. I'd like to have rivers, waterfalls, etc... and that means that I need to rethink how I do it. I'm trying to come up with ideas for the geometry of water. Here is a shot of how the current water system might look if I use it unmodified for multi-level water: Clearly, I need some sort of geometry to tie the pieces together. My first thought is to create a sort of "skirt" piece that is attached to the side of a water hex if that water hex has neighbors whose water height is lower than its own. Might end up looking something like this: The issue with that, of course, is that I have to oversize the skirts to avoid Z-fighting with the underlying ground hex, and that means that skirt pieces overlap with adjacent skirt pieces on different hexes and with the water hex of the lower water levels. In combination with the alpha-blending, this creates bands or regions of darker color where two pieces of water blend together. I could use waterfall particle systems to help obscure this overlap, I think. Alternatively, I could use a solid material instead of a partially transparent one: I dont like the look of it, though. Large areas of flat water look terrible. Granted, there will need to be improvements to the actual water material to make it look better regardless of how I handle the geometry, but for now I'm sorta stuck on how best to do this. I do have some ideas as to how I could perform the geometry stitching of the skirts to minimize overlap, but it'll take the creation of special pieces, and some special-case code. Not too difficult, I suppose, but still seems kinda messy.
16. 5 points

Problem with enum and binary or operator

All variables are just bits in memory, so using it as whatever is totally valid, because they're just stupid bits. That's a weak argument. An enumeration has by definition a restricted range of values, the compiler checks for this and makes sure you don't write buggy code by going outside of this range, which is what you were trying to do. Since you are working with flags, it makes no sense to use an enumeration type. What you want is an unsigned type and some constants. I'd simply do the following: enum { fpl_InitFlag_None = 0, fpl_InitFlag_Window = 1 << 0, fpl_InitFlag_VideoOpenGL = 1 << 1, }; typedef unsigned int fpl_InitFlag; It's clear from the naming that these are flags and there's also a hint to the user that he should use the constants starting with fpl_InitFlag_.
17. 5 points

C vs C++, Objected Oriented Programming vs Data Oriented Programming

Ooh good timing for this thread - Albrecht just posted some new slides! The original 2009 talk (still relevant!): http://harmful.cat-v.org/software/OO_programming/_pdf/Pitfalls_of_Object_Oriented_Programming_GCAP_09.pdf And the 2017 version: https://docs.google.com/presentation/d/1ST3mZgxmxqlpCFkdDhtgw116MQdCr2Fax2yjd8Az6zM/edit#slide=id.g2398a4e2af_0_118 https://docs.google.com/presentation/d/1305-i5JZ98cLqXgVwzTyB1NQUjjBJ0_0diwU2diS_TI/edit#slide=id.p tl;dr:
18. 5 points

19. 5 points

Which approach would be best for checking if an inventory is full in Python?

Since the items are referred to by their tag, then it would be easier to use an associative array, such as dict or collections.OrderedDict. Then, checking if the inventory is full is only a matter of checking the number of tags it has: items = dict() def is_full(self): return len(self.items) >= 8 You are correct in that it is misleading to add an item and not actually have an item added. This is why it is important to signal if an action succeeded and (optionally) provide other ways to determine if an action will succeed. For example: class Inventory: max_inventory_size = 8 def __init__(self): self.items = dict() @property def full(self): return len(self.items) >= self.max_inventory_size def can_accept(self, item): return item.tag in self.items or not self.full def try_add_item(self, item): if not self.can_accept(item): return False self.add_item(item) return True def add_item(self, item): target = self.items.get(item.tag, None) if target is not None: target.quantity += item.quantity else: assert not self.full, "Inventory full" self.items[item.tag] = item # and then: (1) # expect this action to succeed, otherwise crash hard inv.add_item(item) # or: (2) # lazily attempt action, not caring if it fails if inv.try_add_item(item): world.remove(item) # or: (3) # don’t attempt action, but do check if it is possible for shop_entry in shop_menu: if not inv.can_accept(shop_entry.item): shop_entry.enabled = False
20. 5 points

Grown out of playing games

I've long grown out of playing games. Coding games and tools is a different thing all together, I remain fully interested and stuck with coding mobile games and wouldn't choose a different hobby/career (well apart from the fact that I long to improve my coding skills, and my maths and physics knowledge) But playing games, these days (unlike over a decade ago) genuinely bores me to death. I guess I always feel I am coding for the younger generation, similar to enjoying making toys for kids but not enjoying playing with the toys yourself I'm coding mobile games at the moment and I look at and play some few just for gameplay analysis and checking current standards and features but not because I enjoy playing them I know this certainly makes me an odd-ball here, but just wondering how far an odd-ball I am. Is there a few... maybe just one more person like me here OR just me? (if the latter then I have to make sadder clown face )
21. 5 points

22. 5 points

Black Desert Online/ Skyrim style Character Creation

In my experience, these kinds of systems are done by a shitload of art creation, plus some simple morph target tech. Artists also paint which vertices belong to which 'group', so that different parts can be blended differently.
23. 5 points

Why do we split shaders into passes?

The Gaussian blur is separable, meaning it can be done in one direction, then the other and have the same result as if you did a kernel with all surrounding points included. In other words, for a 3x3 blur, you can do an X pass with 3 taps (the middle sample and one on either side) and a Y pass with 3 taps (the middle sample and one above and below) for a total of 6 taps. If you did it in one pass, you would need to sample all nine points, i.e. the center point, the left and right, the above and below, and all four corners - those are values you get for "free" when you break it up into two passes. For a small blur width like the above example, it might be faster to use one pass, but for larger kernels, you can see that the number of samples in the single pass start to add up. For a 7x7 kernel, you would need 49 taps total for a single pass, but only 14 if you break it into separate passes.
24. 5 points

Your Indie Game Will Flop and You Will Lose Money

Long-time GameDev.net member and indie developer @cliffski32 of Positech Games has posted in his latest blog a very direct message to aspiring indie developers: you will flop and lose money. While not the message most aspiring developers want to hear, @cliffski32 discusses the challenges for an indie from a financial perspective with all the costs and revenue losses that developers incur when you factor in staff, legal, and investors. Using data from player unknown: battlegrounds as an example of the high end and assessing the mean game in 348 pages of "Top Sellers" of Indie games on Steam, @cliffski32 makes the point that game development is a tough business. Read the full blog post at http://positech.co.uk/cliffsblog/2017/06/23/your-indie-game-will-flop-and-you-will-lose-money/.
25. 4 points

Special Effects For Games

Hi everyone, I'm creating a series of tutorials about the creation of Game Effects in Unity. I hope it may help someone around here, and feel free to ask questions. Thanks & Enjoy!
26. 4 points

Forward Windows messages to a derived class's virtual CallWindowProc() method

A few things: 1) Yes, gd3dApp is a global. Hence the 'g' prefix. 2) The global isn't actually necessary - Windows allows you to attach a pointer of an arbitrary type to a window, either at construction time or at any point later", albeit at the cost of type-safety. Look up "SetWindowLongPtr". Mind you, the point about not assigning a member function to the window still holds, though, because of how pointers to member functions work in C++. 3) The anonymous namespace is used to prevent the global from being accessible outside the source file in which it is defined. In C we would do this using the "static" keyword, but anonymous namespaces are how modern C++ accomplishes this. 4) Classes are constructed in order of inheritance hierarchy - and destructed in the opposite order. So the base class (D3DApp) would be constructed first, assigning the "this" pointer of the class to the global. 5) If you were to have two classes deriving from D3DApp, and you would instantiate both of them, the global would be set to the address of whichever one was most recently constructed without fanfare. You can probably see why this could be dangerous...
27. 4 points

Getting a job as an AI programmer for games

The main thing I'd suggest keeping in mind is that you might be artificially limiting your options by trying to find an entry-level job which also is a dedicated AI role. Entry level is hard enough to break into as it is, and AI is a specialization that typically involves some baseline experience in making games. Your best bet (IMO) is to get a good title or two shipped first as a gameplay programmer, and pick up the AI as you go. Once you have the basics of shipping code under your belt, you can start looking into the specialization. You should ideally be conversant in all of the following: Decision making systems (scripting, utility-theory, behavior trees and similar architectures, planning, state-search, machine learning [ugh], and so on) Path planning algorithms and data structures Perception modeling (sight, sound, etc.) Animation techniques at least at a high level (know what a blend tree does, how to play animations, etc.) I'm sure there are more things. Pick up a good game AI text and you should at least be comfortable talking about every subject in there. Hopefully that explains why entry level and AI specialization is a hard combo :-)
28. 4 points

Lighting Series

Hi, community. I am writing a series of articles about Lighting related with real-time computer graphics. The purpose is to get information from a lot of great resources like computer graphics books, blogs, and forums, and try to explain them as easy and clear as I can. I am going to update the list periodically. Lighting Series The first post in the list is the following Lighting Series Part 1 - Light and Radiometry Update (2017.07.05) Lighting Series Part 2 - Radiant Energy and Radiant Power Update (2017.07.16) Lighting Series Part 3 - Radiance All suggestions for improvements, corrections, and new topics, are very welcome because in this way I am going to learn a lot and, and why not, maybe this helps anybody with the same doubts than me. Hope you find this useful!
29. 4 points

30. 4 points

Most obsessive you've been about a game?, flip side of grumpyOldDude's question.

I'm sure this question has been asked before, but in grumpyOldDude's post about growing out of games I kinda felt like talking about the time I've been the most obsessive about a game and am curious to know what you all consider to be the most obsessive you've been about a game. So, what' the most obsessive you've been over a game? for me that title easily goes to counter-strike ~1.3 to 1.6. I bought my first computer to... that's right, play counter-strike. I bought surround sound speakers and built a little hole in my basement to immerse myself in counter-strike. I've lost more hours to counter-strike than probably any other game. And it was hard, I remember when I first started playing I would just die endlessly and maybe get a kill every now and then. I so badly wanted to be like the guys at #1 in a match. Then slowly I got better and better and have my own domination stories I'm still fond of to this day. I lived and breathed cs_italy, that was my map. hahaha
31. 4 points

Problem with enum and binary or operator

The compiler is just trying to save you from writing buggy code. You need to go out of your way to force your bugs into your software. Your solution does a fine job of doing that. You're implementing an operator that is not closed on the enumeration set. You're breaking the contract provided by enum. When you start getting weird errors, save yourself some debugging time and check where you use the enum first.
32. 4 points

35. 4 points

GitHub with Visual Studio C++ Revisited

Yes. Don't understand what you are saying there, but in my opinion, you should use the GUI git tools for basic things like pushing and pulling and git shell/command line for more advanced things.
36. 4 points

What should I expect as a one-person hobbyist game developer?

Yes, it's realistic. If your plan is to just make games right now, you should use Unity or Unreal or any other existing technology. These will help you achieve your goal of making games and will simplify things so that you can just focus on your game logic. Of course you can always start from scratch if you want to know how things behind it work, but it's not recommended for a beginner as it can be frustrating and can burn you out.
37. 4 points

38. 4 points

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

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.
39. 4 points

40. 4 points

daughter wants to learn coding

Learning programming typically goes a lot better if you are learning it to fulfill a secondary goal. That secondary goal may well pick your language/framework for you. Is she interested in robotics? Maybe look at something like Lego Mindstorms to start, and then move to Arduino later on. Is she interested in game development? Dive right in with Unity, so that you minimise the time-to-seeing-stuff-happen-on-screen barrier. And so on...
41. 4 points

42. 4 points

What is an expression?

'What' qualifies as an expression vs a statement actually varies across different languages. In some languages the distinction is that expressions evaluate to a value while statements do not. In some languages expressions are just a certain type of statement which happen to return values. In some languages everything is an expression because everything has some kind of a value. For what it's worth you can go a long, long way without ever needing to know the difference between statements and expressions. This is not something most programmers need to think about day-to-day. It's more a concern for compiler authors and language designers and not really something programmers are required to know in order to actually 'use' the language. You mentioned C# though so the rest of my answer is more towards the C# way of thinking... An expression is one or more 'operands' strung together with 'operators'. Operands include things like literal values, variables and function calls and operators are things like +, -, /, *, &&, ||, etc. An expression can consequently be evaluated to a value. E.g. 1 + x * y - func(10) Meanwhile a statement is like an "action" or "instruction" to the computer. E.g. "Declare a variable", "Call this function", "compare this value", "loop over an array", etc. Statements include things like declaring a variable, control-flow statements (if/for/do/while/return/continue/break/etc), declarations of types and methods, etc. Statements as a whole are very often constructed out of expressions. Such as when you declare a variable and initialize it with the value of some expression all one one line: int x = 10 + 2;
43. 4 points

44. 4 points

How hard to port PC game with in-house engine to console

That should alleviate your other concern. As long as all the OS/platform dependent code is isolated into its own CPP files, so that the game code can never include any OS/platform specific details, then you're in a good situation.
45. 4 points

Stop hacking

The attacker fully controls the computer that the game client is running on. Just consider what someone can do with a virtual machine with full suspend/rewind/resume support, and you'll realize you cannot "lock up" the client. The attacker can decompile whatever code is being run on the client, as the client is run it, no matter how much you obfuscate or encrypt the code. Such measures simply don't matter to a determined attacker, because the code needs to be actually runnable by the CPU, and anyone with the right tools can take that instruction stream and disassemble it. Similarly, the attacker can look at all the data you send and receive on the network. It doesn't matter if you use HTTPS or some other kind of encryption, because the attacker can inject themselves in your network code before the encryption is applied. You have four options here: Decide that it doesn't matter if someone is cheating. For games that are largely puzzle games or other single-player experiences, a cheater would mainly just cheat himself. Does that matter at all? Build your system such that the interface to the server is the "game rules," and the data from the client is simply an expression of the players' desires. If the player desires to go left, send a "player goes left" command, and let the server figure it out. If the player wants to fire a weapon at 33 degrees, send that as a command. Do not use any messages that express specific state or events -- don't say "I now have 1000 gold" or "I hit player 3 for 89 damage." For fast-paced games, this will introduce latency, which you will have to manage by some time-traveling smarts in the game client and perhaps on the server. (All of the "multiplayer game models" write-ups you see online basically revolve around the different ways of doing this.) Decide that your game is not going to be particularly popular, and thus cheaters will not likely discover your game, and if they do, they will not be likely to actually want to spend a lot of effort on it. Research all the cheating tools, and keep a constant watch out on various user forums for your game, looking for exploits. Patch each of them as you find them. Study the cheating software in detail, and come up with a mitigation that works for each of them. Keep working on this, every day, for as long as your game is alive. Which one you choose is up to you.
46. 4 points

What modern, open-source compression library should I use

If you haven't measured your actual code with a profiler, now is the time to start. Blindly optimizing everything you can grab is a sure-fire recipe for spending a lot of time and being disappointed in the results. If you know what is slow about your code, you can make an informed decision about whether or not reading from an archive is going to make a significant difference in your situation. Engineering is a discipline. Don't give it short shrift by merely hacking at your load times.
47. 4 points

48. 4 points

Grown out of playing games

Maybe you're just playing wrong games
49. 4 points

A correct way of writing this?

Extending a standard library container class is almost always the wrong approach. There are very few things in the standard library designed for extension, and those are clearly indicated. It is possible to extend some of them, but it usually comes with unexpected ramifications. Your desire to mix smart pointers and raw pointers, as well as trying to describe what can be copied all reek of a common problem. Controlling the lifetime of objects is a critical aspect of software, especially true in games. What you describe sounds like a symptom of not understanding what code owns the lifetime. What is the REAL problem you are trying to solve here? You came up with a solution of trying to do complex things with a vector, but what problem drove you to that solution?
50. 4 points

Using Exceptions

Ellipses catch is very useful when you want to do some cleanup and rethrow.

1. 1
2. 2
3. 3
frob
25
4. 4
5. 5
• Member Statistics

• Total Members
235694
• Most Online
4004