• ### Announcements

• #### Wondering what's new and changed at GameDev.net?06/20/17

Check out the latest Staff Blog update that talks about what's changed, what's new, and what's up with these "Pixels".

Members

24

281

Moderators

21

11895

21

3642

Members

19

1461

## Popular Content

Showing content with the highest reputation since 05/23/17 in all areas

1. 18 points

## GameDev.net Turns 18!

On June 15, 1999 - 18 years ago today - our band of developers and "webmasters" launched GameDev.net. Here's the story: What you may not know is that none of us met each other in person until several years later. We have always been and remain a virtual team - although at the moment it's just myself and the Moderators. Team meetings were held over Internet Relay Chat, or "IRC" for the kids, and we'd communicate over ICQ, which amazingly still exists (although I've had comments saying the same to me about GameDev.net.. 18 is old in Internet years). To give some perspective, 18 years ago Unreal was starting to form the concept of a game engine and entering a battle with Quake. Unity was a dream. The GPU as we now know it did not exist commercially (we broke NVIDIA's GeForce news). And shortly after our launch a particularly large search engine contacted us to see if they could be our search engine, as I'll share in this team meeting chat log from July 18, 1999 - a month after we launched. <Mike> I have another thing to mention <Mike> Google.com wants to do our search <TheAgnostic> ?!? <TheAgnostic> They contacted us? <Khawk> who's google <Mike> They want to be our search engine for the site <geoffh> k - a search engine, like AltaVista, but nicer in some ways <geoffh> mike - how do you feel about it? <Mike> Well.. their results are unique <TheAgnostic> They are a very impressive search engine (more a technology than anything else). They are going to IPO or just did, I can't remember. <Khawk> wow, i've never heard of them [/font][/color] <Mike> We'd have a search page at [/font][/color]www.google.com/gamedev <geoffh> will they go down/work slow, etc?[/font][/color] <Mike> No idea.[/font][/color] <TheAgnostic> I can speak to the last one, they are expected to get a sh*tload of money, so their servers will likely be fast.[/font][/color] <geoffh> you think itd be better than our own deal? <geoffh> didnt you do a kick ass search engine mike? <Mike> Yeah, it works pretty fast. GameDev.net started as a labor of love, and 18 years later it continues to be a labor of love. While I remain as the only founding member, I know that the founders who are no longer with the site hope it continues to provide value for the game development community to learn, share, and connect with others for many years to come. But the amazing thing to all of us continues to be the community. I may be biased, but for 18 years I have not come across a better community than the GameDev.net Community. We are a passionate, knowledgeable bunch, and we love discussing, sharing, and learning from others about the problems, technologies, and challenges of game development and the games industry. Throughout GameDev.net'story we've watched so many of you grow into the games industry, often starting as hobbyist or student developers with a thirst and desire to achieve your dreams. It's been our greatest pleasure to provide the platform that has helped so many, and we love to learn about your own journeys in the industry. In the meantime I want to thank the amazing GameDev.net community, again, for these 18 years. On to the 19th! p.s. The site upgrade is happening this weekend, finally! Stay tuned.
2. 10 points

## Doors, Dungeons, MakeHuman, Bug Fixing

It's been a little bit of an art push lately. First of all, I started work on a dungeon tile set. Up there is my first stab at it. I created a couple different wall variations, a door and a hex-pattern tile ground texture (used in conjunction with existing sand and gravel textures). Don't have anything in the way of doodads or decorations yet. Doors are still kinda tricky. I had a conversation with riuthamus about it. The gist of doors in this game is that a door needs to work with any configuration of walls around it, so trying to do artwork for a traditional-looking door and choosing alternates to match up with the surrounding walls was getting to be too difficult. I had already implemented doors some time ago that utilize portcullis-like behavior: when you open the door, it slides into the ground. Closing it brings it back up again. The door in the above shot works the same. The issue lies in creating a graphic that looks door-like, even though it doesn't look like a traditional door. I'm not sure there's a perfect solution for it. But at least when you hover over a door, a popup appears with the label 'Door'. Hopefully that's enough of a clue for people to figure it out. I've also started experimenting with MakeHuman. The ogre in this shot is a result of that experiment: It was a quick effort. I just used some of the clothes provided with MakeHuman (hence the jeans and button-up shirt, articles of clothing that would be quite difficult to obtain in the Goblinson Crusoe universe) and ran some of the various sliders for the mesh deformation all the way to 11 to try to get an ogre-ish form. The experiment worked pretty well, I think, certainly well enough to warrant further experimentation. As a bonus, MH will export a skeleton rig to fit the mesh, though I still have to rig it with IK and animate. As it turns out, I'm still terrible at animating. Who knew? I spent some more time doing miscellaneous cleanup. Fixed a bug that caused creatures to die multiple times if they died in a round with multiple dots on them. (They would die once for each dot because I wasn't checking for isdead in between dot applications.) Formalized the construction of summoning spells, so that a flashy spell effect is played when things are summoned. Added some flashy effects for things dying. Moved and rearranged some data tables again. You know, crazy shit like that.
3. 9 points

## A new Game Style

Game rules are specifically excluded from copyright - they can't be protected. Specific implementations of algorithms can be patented, but this doesn't really allow you to protect game ideas. Design-patents allow you to protect the look of a product, such as the shape of a coke bottle or the UI layout of Tetris... Patents are also horribly expensive, need to be written by expert lawyers (again horribly expensive) and if anyone violates your patents, you'll need to wage legal war against them (sue) which is again, horribly expensive. No one bothers with that stuff in the games industry. The extent to which your ideas can be protected is not worth the cost of that protection. As for trying to sell it, nobody buys ideas. Most people wont even let you pitch an idea to buy as (1) It's a waste of their time and (2) it opens them up to legal liability - if they're already working on a similar idea, you'll complain that they've stolen it from you. The real value is in the implementation of ideas, not the idea itself. Ideas are only a starting point of a very long an expensive journey. Game designers do not just write down an idea and then go home for a year while it's created for them. Game designer is a full-time job for the entire duration of a project - constantly guiding the development team and refining the idea as implementation of it exposes rough edges that could not have been predicted at the start. Companies don't buy ideas, or hire idea-people, they hire designers. The exception is is you have an idea and lots of money. In that case you can hire a studio of designers and developers and give them your idea... If you don't have money, you could take the idea to investors first, to convince them to give you the money... But you will need way more than an idea - you'll need an entire business plan and enough business acumen to put a realistic value on your company (which has nothing but a valueless idea and no ability to execute it,a very risky investment). You can try and do the kickstarter thing, but it's the same deal - just an idea and no ability to execute does not inspire confidence... Plus you'd have to disclose the idea. Alternatively if you want to extract some value from it, you can just go ahead and start refining the idea further in public (on forums, blogs, etc). In the unlikely event that someone steals your idea, at least you'll be known as the inventor / first person to publish the idea,which, if it actually is revolutionary, is a great thing for a future career as a designer. Chances are that no one will steal it though as everyone has way more ideas already than they have the time/money to create
4. 9 points

5. 7 points

6. 7 points

## When To Use Pointers?

I saw this image days ago, I liked how didactic it is:
7. 5 points

8. 5 points

## Grid-based game: Serialising position

If the scripts performing movement are purely cosmetic, then their state doesn't need to be saved to disk. If I'm playing a chess game and the rook is moving from A1 to A8 and I quit while it's animating somewhere between A4 and A5, I expect to reload and either see it at A1 where it's still my turn, or A8 where it's the opponent's turn. (I'd prefer the latter.) The underlying game state is one or the other - the animation state, where the piece is moving from the old position to the new, is purely visual and doesn't need to be saved anywhere. If you do have long-running actions that need to persist - e.g. it's an RTS game and you commanded a unit to walk across the map - then usually the command is attached to the unit that is executing it, and that would be saved out along with all other in-game state (which would reflect the visual position, as that is a valid game state, unlike in the chess example). The main thing here is to have a clear idea of what is actual game state that absolutely has to persist across sessions, and what is just a visual representation that can be recreated from the game state and which doesn't need saving at all.
9. 4 points

## Why are licensed game engines being used more frequently?

Game developers use licensed engines for the same reason I use a web browser made by someone else. It's faster and easier if someone else has already done the work. In theory I could code up a functional web browser and it might even work better for me in some ways but why waste that time?
10. 4 points

## UE4 Blueprint & C++ Cheat Sheets

Reddit user Wafflyn made useful Blueprint and C++ cheatsheets for anyone using UE4. From the post: UE4 Blueprint Cheat Sheet: http://uecasts.com/resources/unreal-engine-blueprint-cheat-sheet UE4 C++ Cheat Sheet: http://uecasts.com/resources/unreal-engine-c-plus-plus-cheat-sheet
11. 4 points

## Yet another SDL question (or maybe it's not)

Your constructor is wrong, and you are using uninitialized data. When you draw, you're copying the uninitialized values from the member into the rect, and then you attempt to draw. x = x will assign the value of argument x to itself -- it will do nothing. To refer to the member's x value, you need to write "this->x". This is because when you just write "x", there's no way for the compiler to guess which "x" you want to refer to. Because of this, it will always pick the values passed into the function. Thus, you need to write "this->x = x;" -- and similar for the other lines. In case you're wondering, all class and struct instances have a "this" pointer, which is what we're using to solve this problem. Another solution would be to rename the argument values to something else. Either will work, but it's important to understand why the current code is broken.
12. 4 points

## Doors, Dungeons, MakeHuman, Bug Fixing

This is looking better, and better. I really like the warm color pallet.
13. 4 points

## How to achieve smooth tile-based movement with C++ and SDL?

Simply interpolate between the old and new positions in the grid and ignore input during the animation. Perhaps something like: void Player::update(float dt) { if ( this->move_state == MoveState::STOPPED ) { int2 dir = this->process_move_input(); if ( dir ) { this->move_state = MoveState::MOVING; this->move_timer = this->move_speed; // in tiles per second this->old_pos = this->pos; this->pos += dir; } } else if ( this->move_state == MoveState::MOVING ) { this->move_timer -= dt; if ( this->move_timer <= 0 ) { this->move_timer = 0; this->move_state = MoveState::STOPPED; } } } void Player::draw() { int2 pos_px; if ( this->move_state == MoveState::MOVING ) { // move_timer goes from 1 to 0, so math on positions is reversed from the traditional A→B interpolation pos_px = this->pos + float2(this->old_pos - this->pos) * (this->move_timer / this->move_speed) * TILE_SIZE_PX; } else { pos_px = this->pos * TILE_SIZE_PX; } // draw avatar at pos_px }
14. 4 points

## Teamwork - Debugging and Development

First, a bit of introduction to work with source control. Details depend on the system you are using, but in a nutshell, there is a server with the master version of the code (as, for instance, github.com). Everybody who needs to work with the code, downloads a copy of the code from that server into their computer and work on that local copy in their computer. Once they are done working on a particular feature, they update the code in the server with their changes, and now the master version has their changes available to anybody that's going to work with that code in the future. The good thing about source control systems, is that they allow multiple people to work on the same codebase at the same time. When two people have been working on the same codebase at the same time, they didn't see one another's changes because they were working on their local copies. They will see one another's changes when they try to update the master version with their changes, and someone will have to merge both updates. One of them is going to be lucky and update the master version before anybody else, so the master version will be the same that they downloaded. No trouble. The next person that tries to update the master version with their changes, will find that the master version is no longer the same code they have been working on. Then, that person will have to download the changes and make sure their code works. If they are lucky, the previous person won't have touched the same code as them, the source control system will be smart enough to merge their changes and everything will work out. If not, they will have to go over their code and make sure that the recently updated master version works with their changes before updating again the master version. In my experience, you usually try to avoid working on the same part of the code. If I'm working on the same feature with another developer, we either sit together in front of the same computer and work together (that's usually known as pair programming, by the way) or work on different parts of the code. It happens, however, that you end up touching the same part of the code as somebody else that is working on a different feature. In those cases, if the person modifying the code sits close to you, you just sit together and review the parts of the code that you both have changed to make sure that both features work properly. Otherwise, the other person has hopefully written tests to make sure their feature works, so you fix any compilation issues, run the tests and fix anything that is not working. Debugging has nothing to do with source control. When you debug, you use the copy of the code in your computer, so you don't use or affect the master version of the code at all.
15. 3 points

## drawing sprites

What it looks like you're trying to do is draw the first sprite, and then "wait" (is this why you were asking about Sleep()?) and then draw the second. This won't work. The "wait" call you are attempting to make here will just halt everything for the duration of the call, giving the program the appearance of freezing for a second or however long you are waiting. The correct way to handle this kind of thing is, unfortunately, more complicated. What you can do is keep track of how much time has elapsed between the last time you called drawScene() and this current call to drawScene(). There are various ways to do this, using various platform-specific or platform-agnostic timing APIs that can give you the "current time" in some fashion. std::chrono::high_resolution_clock is probably a reasonable place for you to look at (specifically, the now() function). void drawScene() { auto timeStampNow = std::chrono::high_resolution_clock::now(); auto elapsed = timeStampNow - timeStampPrevious; // ... timeStampPrevious = timeStampNow; } Here, you get the current time, subtract it from the previous time (which you are storing elsewhere, in a member variable perhaps) and compute the elapsed time since the last call. At the end of the function, you set the "previous time" to the current time, so it's correctly set up for the next time drawScene() is called. Once you have this elapsed time, you can use it to "count down" until the next time you are supposed to do something. If you have another member variable that is, say, "timeUntilSecondSprite" initially set to some value corresponding to how many seconds until the next sprite show up, you might do timeUntilSecondSprite -= elapsed; if (timeUntilSecondSprite <= 0.0f) { // Counter has run out, draw the sprite now. } You can implement as many time-based effects as you want with this approach, optionally resetting the counters when they hit zero if you want them to occur (for example) every N seconds.
16. 3 points

## Why are licensed game engines being used more frequently?

I think the reasoning is actually pretty straightforward. Basically, the complexity of what consumers expect in a game is continually increasing, meaning that engines also need to become increasingly complex. That means the cost of maintaining a custom engine even through a single development cycle is also going up. Meanwhile, accessible third-party engines are not only keeping up with this complexity, they're also becoming much more mature (and generally less expensive, too) than they were even a few years ago. All in all, in a lot of cases, it just costs less time and money to use a third-party engine. Furthermore, there's no reason I can think of that this trend won't continue. Even if a custom engine seems like a good idea for a project now, it probably won't be for some future project, so using a third party engine now means you'll already have valuable experience with the engine you will use in that future project.
17. 3 points

## When To Use Pointers?

The default case is to work by value: void doThing(int num) { num++; } In this case 'num' is a copy of whatever you pass in when calling the function. int derp = 1; doThing(derp); //derp still equals 1 because it was a copy that got incremented If you want to be able to modify the original value then you can pass by reference: void doThingByRef(int& num) { num++; } Now 'num' is effectively a direct alias of whatever you pass in: int derp = 1; doThing(derp); //derp now equals 2 There's another case to consider... What if the thing you're passing in is large, but you don't want to modify it? You don't want to do an unnecessary copy, so you may use a reference, but that suggests that you're modifying the item within the function. In this case you could use a const reference: void doThingByConstRef(const BigThing& thing) { ??? } This lets you read 'thing' but not modify it (you'll get a compile error). These are the basics of reference semantics. Pointers are similar, but they have some additional properties: 1) A pointer is "nullable". That is, it can be set to 'nulllptr' in order to indicate that it doesn't actually point to anything. 2) A pointer is "reseatable". That is, it can be modified to point at something else. A note about pointers and constness: int* num; //the pointer can be changed and the int that it points to can be changed const int* num; //the pointer can be changed but the int that it points to can not int* const num; //the pointer can not be changed but the int that it points to can be (probably use a reference instead in this case) const int* const num; //neither the pointer or the pointed-to int can be changed (probably just use a const reference instead) Be careful about returning pointers and references from functions. If the thing that you're referring to is destroyed or moved then you end up with a dangling reference/pointer, and that's no fun at all. So the basic rule of thumb here is: Use value semantics by default. Use references when you want references. Use pointers when you want references that are reseatable and/or nullable. Cheers.
18. 3 points

## ID3D11Query reporting weird results

This behaviour sounds exactly like what I'd expect if the GPU was throttling back its frequency because you aren't giving it enough work to do to warrant being clocked at peak frequency. By turning off VSync you're giving the GPU as much work to do as it can manage. With VSync enabled you're restricting it to 60 frames worth of work per second which it can easily deliver at reduced clock speeds.
19. 3 points

## When To Use Pointers?

It's important for you to understand how regular, "non-smart" pointers work, so I do encourage you to learn. But once you learn how, it should illustrate just how much more useful smart pointers are when it comes to the actual management of object lifetimes. There are very few cases where "having additional control over when to free the pointers" is worth the trouble, and none of them are applicable to a beginner. That said, smart pointers are not a magical bullet and I disagree with the common dogma that says a regular pointer should never appear in one's code. Generally I use smart pointers such as std::unique_ptr (I rarely have a concrete need for std::shared_ptr) where I need to use a pointer to manage lifetime. I use a bare pointer where I need a nullable reference and lifetime management isn't involved. Another way to say that is that systems that own objects might keep smart pointers referring to those objects, but hand out bare pointers to client code if handing out a C++ reference ("Thing&") isn't feasible. If this seems like too subtle a distinction, then I encourage you to simply use smart pointers until you are more comfortable with the ins and outs of lifetime management in code architecture, and then revisit the topic with your improved understanding and experience at a later time.
20. 3 points

## [DirectX9 Bitmaps] Can someone help me out with a nullptr check?

this creates a d3d device, and d3d points to it. and then this sets d3d to NULL, then checks to see if d3d is zero or non-zero, and executes the code block if its non-zero. Since it was just set to NULL (ie zero), its never non-zero, so the code block never executes, and you are always NULL-ing out your d3d device pointer. A guaranteed show stopper there. this is because evaluating expressions inside the condition statement has a higher precedence (IE gets done first). In the end its simply a typo quite common to c/c++. lesson learned: always double check those == statements. its a typo that syntax checking can't pick up, which leads to a logic error. it can only be found by code inspection or testing (or both ?).
21. 3 points

## Horizon:zero Dawn Cloud System

Hello again, I'm going to be presenting a 40 Minute Talk at SIGGRAPH 2017 as part of the Advances course again. I am going to cover the noise generation and weather system as well as our authoring approach and some other updates. If it is allowed, I will share the Houdini tool that I made to generate our noise with the public. This way you can also experiment with other configurations. Hope you can make it or review the slides when the come out. Andrew PS this is awesome!!!
22. 3 points

## Database Structure for MMO's

It's totally normal, if you consider a character as being an entity with a well-defined set of skills. If you believe that skills are separate entities unto themselves, and they come and go (rather than the character just raising/lowering/enabling/disabling them) then, yes, you need a separate table to join characters to skills. I would recommend that you do NOT go for flexibility right now, because making just your first game is going to be hard work enough -- you're not going to have lots of time to try many different things, at least not to the point where you will put them into the database. That being said, if you really believe this is an area of quick iteration, then just slam 'em all into a single JSON blob and call it good! Separately, I would advise NOT to use an ORM. Ever. For any application. Objects in RAM behave differently from rows in a database, and the impedance mis-match that happens when you try to join them, ends up killing projects. And, what's most insidious, is that this kind of death only happens towards the end of the project, where scale makes itself known. Projects that manage to pull out of this, typically re-code their ORM integration in raw SQL, and exactly how painful that is, depends on how heavily they relied on the ORM "magic" before then. http://blogs.tedneward.com/post/the-vietnam-of-computer-science/ https://blog.codinghorror.com/object-relational-mapping-is-the-vietnam-of-computer-science/ http://seldo.com/weblog/2011/08/11/orm_is_an_antipattern Programming with relations in memory is actually, in general, a better model than programming in "rich" objects, anyway -- this is the learning from the "data oriented design" movement that's basically taking over high-performance gamedev in the last 15 years or so.
23. 3 points

## How to cause bugs that you don't know how to do it?

There is also the possibility that the bug itself is non-deterministic. For example, many forms of memory corruption manifest differently depending on where in the address space individual objects happen to be allocated. For a bug of that type, exactly reproducing the steps doesn't offer any guarantee that the bug will reproduce. You may have to fall back to stressing out the system in the hopes that it reoccurs randomly. Or, if you can't reproduce the bug, then the programmer may have some luck running Valgrind (or an equivalent tool) to chase down buffer overruns and other common causes of memory corruption.
24. 3 points

## Unreal engine 4 compiles since one hour...

This is a terrible idea on any well-architected project of any scale, though. If you only compile a single TU which is effectively token-pasting (via the preprocessor) every other source file, then you're effectively recompiling the entire code base on any change. In other words, you're throwing away one of the very few advantages one can capitalize on in the C++ compilation model: separate compilation and linking. On modern platforms, discarding separation of TU compilation also tends to discard the ability to distribute compilation, further increasing compilation times. This is a reasonable approach for small projects that want a simple (source-only) distribution mechanism to avoid binary file format distribution problems (a description that fits most of Sean Barret's libraries which you are referencing). Once a project grows beyond the point where any change should cause a full-recompile, it starts to become exponentially less of a great idea.
25. 3 points

## Spatial Hashing.

Much like a normal hash map, there's no particular requirement that a bucket in a spatial hash represent exactly one location in the world. It is required that nearby objects hash to the same bucket, but not that all objects in the same bucket are nearby to one another. You can trivially define the buckets to repeat across the world (i.e. by adding a modulo to your hash function), and then when checking for nearby objects, you first find the matching bucket, and then check the actual distance of each object in the bucket. This matches the behaviour of a normal hash map a little more closely, and removes the need for arbitrarily large cells, or other complicated datastructures.
26. 3 points

## New Software and Server for GameDev.net

I am stunned. How are the heck are people saying that the upgrade has been good? - Old articles are broken. The value of gamedev.net tumbles. So now I need to set up an activity list? I'd rather the older option where the forum topics are bumped up upon a post. The live feed was what I'd consider a majorly interesting part of the site. Over the past several updates gamedev.net has been getting more and more bloated. Design has also taken a turn for the worse. For example, when I'm reading a forum post I don't have a need to see Game Job's or Ads at the right side of the post. It makes information harder and harder to read and to find. Color contrast looks really bad imo, light grays and whites.
27. 3 points

## Mesh facing the wrong way!

Unity sucks this way. It has to do with Unity's coordinate, then there is also the fact that it can't import normals correctly, it's scale has problems, it imports smooth groups wrong... In short: there isn't any format, mesh type or 3D software than Unity imports correctly. So here is what you do: You import your 3D software file, if you use Blender that means importing the .Blend. Remember to delete everything in the scene you don't want to import. Once you have imported this file you will find it is attached to a container, a empty 3D object. Apply movement to this object instead of the character. The character is attached to this object and will act with it, this object has the correct rotation for Unity. No matter if you use Blender, Maya or Max; Unity will import the mesh as a .FBX, so there is no downside to doing things this way; in performance. Although if you give someone the editor files they also need the same 3D software. Check that Unity calculates the normals and tangents, instead of importing them. Don't bother with smooth groups, they increase the vertex count, limiting the batching Unity can do with a object. Always build your material in engine, no matter what engine you use. Importing the 3D software file is only a short term solution, you will need to make the proper adjustments at some point. To do this make a axis in your 3D software and align it with Unity. If you want I can explain more about this.
28. 3 points

## Balancing server update loop

First, you should not keep updating networking in a time loop. Drain all incoming packets until recv() returns nothing, and then process all incoming packets until the incoming packet queue is empty, and then go on to perhaps step the world again. Second, I don't see your code subtract anything from the "dt_sys" and "dt" variables inside the loops. You'd never break out of the loops. Third, I don't see your code increment "dt" and "dt_sys" variables outside the loop. Given the description you suggest, it sounds to me as if you are perhaps not managing that correctly, and building up "wrong" dt values? Fourth, what timer are you using to measure time? If you're using Windows GetTickCount(), or even timeGetTime(), those are terrible for resolution. You'd want something based on QueryPerformanceCounter(). On LINUX, you want something based on clock_gettime(CLOCK_MONOTONIC_RAW). On both systems, gettimeofday() is also not particularly stable and should be avoided. So, if you rip out "dt_sys" from your code and just run the code that's inside that while() block once per outer loop, that's a good first step. Then, show us the code that increments and decrements "dt" and the code that reads the clock. Then, if you're still having trouble, we might be able to meaningfully help with details.
29. 3 points

## [DirectX9 Bitmaps] Can someone help me out with a nullptr check?

Here goes one problem if (d3ddev = NULL) { MessageBox(hwnd, "Error creating Direct3D device", "Error", MB_OK); return 0; } Use '==' to test for equivalancy. Which explains why you make it to the exception being thrown. I'm guessing this call is failing here. Make sure the values you are passing to this function are valid d3d->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);
30. 3 points

## New Software and Server for GameDev.net

Still getting the hang of where things have moved to, but other than that everything looks and feels great!
31. 3 points

## University or job experience?

Are you sure that you enjoy programming? Programming as a job is very different from doing it in school or for side projects, you really gotta be fine with mundane problem solving to stick with it. Taking your current skills and working for a year might help you make a more informed decision. I can only speak to the U.S., but getting a 4-year Computer Science degree is really the best bet (if you're sure that you want to program). From there, you can either get a regular programming job and work on games on the side, or do games-related side projects during the degree and go straight into the games industry when you graduate. Also, you'll always have the degree as a fallback if you do go straight into games.
32. 3 points

## University or job experience?

The game industry is relatively forgiving in substituting experience for a degree - but not just any random work experience. If I have an applicant who doesn't have a degree, I need to be assured of a couple things: There's a good reason for not having a degree. Money (in the US) is a valid one. "I didn't think it was useful" is not. The work experience and independent projects are sufficient to produce a capable engineer in general. The actual abilities and skillsets are directly relevant to the job at hand. There is intellectual potential for continued growth and advancement. In that light, I have some comments. "It's two years of formation, VERY practical, it doesn't enter into abstract things like algebra." Red flag. Algebra (and linear algebra) are not abstract nonsense, they're absolutely foundational. If you can't demonstrate basic mathematical competence then I have zero interest in hiring you for any programming position. "Right now, I'm doing a 1 month Unity course in my city, organized by an university, very solid (I was given a scholarship)." While this is a perfectly good way to achieve personal growth, it has no relevance to employment. "The design teacher (a really good professional) told us that he can help us to get a job as QA tester in a videogame company." While I have some friends who have followed this route, I don't advise it. In general, I'd rather see someone doing non-game programming work than spending time in the QA trenches just to say they were in games. QA is a better route for those who have minimal relevant skills of any sort. "Also, I've given a job offer for Java Programmer in a consulting company. It's not videogames, but it's programming experience. That's a safer route." Unfortunately, Java consulting is very unlikely to get you into the game industry. It's a good way to make ends meet while doing independent projects that can demonstrate your abilities, though. To be candid, I get the distinct vibe that foundational Java programming is all you know. That is not even remotely sufficient to get a games job. While both the university and job experience routes are ultimately viable, neither one automatically gets you there. In either situation, you're going to need to do substantial independent work to be considered qualified for a game programmer job. Generally the university path is much more likely to give you a smooth entry into the industry, as it raises less questions about your abilities and decisions. The main reason for not doing so in the US is related to the financial challenges of going to a university. If you're going to attempt to use job experience instead, it should either be because you need to make ends meet or because the job experience is strongly relevant to the game industry.
33. 3 points

## Teamwork - Debugging and Development

I agree with everything Avalander said. Additionally, I would also stress that if you are working in a team and you are doing something which might affect the workflow of others, communication is vital. Whether it's a quick check to make sure you're not both trying to fix the same bug without knowing that the other person is doing the same, or for planning out more large-scale tasks. It's also important that, when (not if) things don't go exactly as planned, you are able to communicate with others and quickly find the best way forward.
34. 3 points

## Another RPG Masterpiece? Searching for Team!

I want to start a project with RPG Maker, but I want to do it unforgettable. I want to do this game has very interesting story. Like Mad Father,Ib.. I am an artist, so I can only draw. I still need a programmer,musician and a writer for story. Can you help me for this journey?Contact me! I can't paid you.I will just be thankful.
35. 3 points

## Earnings and Statistics from my 2nd Android/WebGL Game

Hello all, 1 month ago I had released my 2nd game on Android and WebGL. It’s a simple clicker/idle game, in which we gather funds and we buy upgrades, from time to time, we make decisions. I must say, that creating this game, was very fun. „Tree Tap – Money Idle Clicker” Was downloaded by 539 users, WebGL version got 13500 game plays, those numbers are not big, to be honest, those statistics are really weak, but I’m glad that someone had played my game. 141 users had download game from Amazon Store, 398 from Google Play. The Biggest number of downloads (in one day) was 72. Game is downloaded 12-14x/per day. As a curiosity, record of my first game (downloads in one day) was 30. Actual number of downloads of my first game is 427. How does earnings from „Tree Tap – Money Idle Clicker” looks? $19.46 (Kongregate)$2.37 (Unity Ads) \$0.61 (Chartboost) I can’t withdraw those cash, it’s too small. I was ready for those earnings, I don’t hope too much on earnings, I still learn, I think, that my games are too weak, to earn some cash. For marketing, I had use: Twitter, Facebook, Reddit, Wykop(Polish website) and I had written to many youtubers, sites. I was also frequently updating game, based on players requests. As a next curiosity, my game is frequently used on those devices: Some Data, about users of my game: Google Nexus 6P - 4.5% Samsung Galaxy S7 Edge - 4.5% Samsung Galaxy S7 - 2,8% Google Pixel XL - 2.0% A lot of Samsung Devices ( 60-70% ) What are my plans? I plan to make new updates for „Tree Tap – Money Idle Clicker”, then I will learn new things in C# and I will make next game. I think, that it will be next clicker, but I plan to make a other mechanic for it, it won’t be boring clicking. If You got any questions, feel free to ask them, threat this as a curiosity, I got 18 years, I’m still weak newbie. Tree Tap – Google Play Tree Tap – Amazon Store Tree Tap – Online Version, Kongregate Facebook Twitter
36. 3 points

## Paste of Code Usage

You could post it on Git. I always view these paste it things as just for sharing throw away code snippets, not for entire projects. In Visual Studio (I don't know what environment/IDE you're using) you can synch up with a Git repository, and commit your project, and it's directory structure. This makes it a lot easier for sharing, and even working with other devs (You can branch off the main project and work on smaller features in a way that won't destroy the build when something goes horribly wrong). I'd recommend creating an account if you haven't already: https://github.com/ I just think more people will be likely to dig through 11 source files in a nice repository than 11 separate hyperlinks.
37. 3 points

## Wireframe mode not drawing all primitives, what am i doing wrong

tl;dr, but did you disable face culling?
38. 2 points

## Update#2

Don't forget to make it flexible enough to pool more than just bullets. Pool ALL THE THINGS!
39. 2 points

## Yet another SDL question (or maybe it's not)

Other general comments: don't do delete this. That is just asking for trouble. Objects should be destroyed by their owners. Your test.set_animation call is completely dangerous because you pass a pointer to a local variable. That means the pointer is completely worthless once the KeyUpEventHandler function returns, meaning you are likely to see a crash. Exactly the same applies to the AddObject call below that. you don't really need the x, y, w, h AND the rect - they're both the same data, right? your _destroyed variable currently serves no purpose - if you've already deleted an object, then it is completely destroyed - there is no point trying to read it to see whether the object is dead or not. That value may not be correct, and it may not even be in memory you are allowed to access any more. This is why you need to have an object's owner destroy the object.
40. 2 points

41. 2 points

## Modern empire builder / total war game?

Hi! Ive wanted to make a total war-like empire builder set in modern times/post apoc. It may be tricky, but this is the plan so far (it will not aim to be as serious/realistic as total war or the paradox games). Plz comment! 1. Its set in a near future, where a global virus or asteroid or something has reset the world and killed off most humans. The player controls one of several upcoming empires competing for world domination. Some cities remain but in reduced state. Empires are influensed by the world before but new dogmas/religions exist. 2. Its single-player, turnbased. You control cities on the world map which build units and structures. 3. Units form armies and when armies meet (typically to defend or conquer cities) a turn-based battle starts. Battles are played on a grid/board like a simple version of advanced wars or heroes of might and magic. Inf, tank, artillery, choppers etc are moved around on the grid and attack the enemy. Inf are stronger in forest/urban tiles etc. I know, this is NOT how modern war are actually conducted (armies meeting in "line battles"), but i hope the player can accept this anyway as it makes fun gameplay. 4. There is also long range bombing, firing missiles, bioweapons etc, this is handled from the map (not during battles). 5. 4 resources.  a. Funds. Pay for most things. Earn from taxes, mining, agriculture etc b. Fuel. Needed for mid/top level vehicles (tanks, aircrafts). Earn from cities with drilling or synthetic factories. c. Power. Needed for structures. Produced by powerplants in your cities. For simplicity, power balance is empire-wide. d. Tech/Development. Unlocks units/structures and bonuses. 6. Managing cities is a big part of gameplay. Setting taxes, managing order, corruption etc. Im not sure how to handle production. An idea: a. Infantry units available to recruit is generated by strcutures ("barracks"). Once available, ordered infanty units always take 1 turn to recruit.They have their own training cue. This works as in medieval 2: total war. b. Most vehicles are built in "military factories". Each one has production (like 40p/turn). A tank may take 20p so that city can make two tank units per turn. These items go in a separate "factory cue". c. Structures should have their own cue. It feels wrong to mix with military production. Maybe fixed time: like a "large barracks" always takes 2 turns? . Thoughts? Both on the setting/lack of realism and the mechanics presented. Thanks! Erik
42. 2 points

## How to cause bugs that you don't know how to do it?

As mentioned, log everything whenever there is a crash. Even if you can't reproduce it today a pattern may eventually emerge. Among the non-reproducible crash bugs in one project, one tester noted a pattern for some of them. Rarely someone would crash after winning a multiplayer game. The specific tester noted the crash was typically on a Thursday mid-day to afternoon. That was finally the key information to a crash we'd seen a few times. When the log files on the server was rotated and weekly scores reset, the server would send back an empty set of high scores to the first victor, and the code blindly dereferenced the first item on the list. It could happen under other circumstances, but always happened on Thursday mornings when the rotation and reset happened.
43. 2 points

## How to cause bugs that you don't know how to do it?

No one can tell except maybe the programmer who wrote that code. The best way to figure it out would be to recall how you encountered that bug and repeat that process in hope of finding it again.
44. 2 points

## SpatialOS single shard MMO

Also, a variety of multi-entity architectures have been tried. The most famous failure is probably Sun Darkstar, which ended up supporting fewer entities in cluster mode than in single-server mode :-) They used tuple spaces, which ends up being an instance of "shard by ID." The other main approach is "shard by geography." A "massively multiplayer" kind of server ends up with, at a worst case, every entity wanting to interact with every other entity. For example, everyone try to pile into the same auction area or GM quest or whatever. (Or all the mages gather in one place and all try to manabolt each other / all soldiers try to grenade each other / etc.) N-squared, as we know, leads to an upper limitation to the number of objects that can go into a single server. Designing your game to avoid this, helps not just servers, but also gameplay. When there's a single auction area that EVERYBODY wants to be in, it's not actually a great auction experience (too spammy,) so there's something to be said for spreading the design out. (Same thing for instanced dungeons/quests, etc.) Anyway, once you need more than one server, then you can allocate different servers to different parts of the world (using level files, or quad trees, or voronoi diagrams, or some other spatial index,) To support people interacting across borders, you need to duplicate an entity across the border for as far as the "perception range" is. This, in turn, means that you really want the minimum size of the geographic areas to be larger than the perception range, so you don't need to duplicate a single entity across very many servers. If by default you have chessboard distribution, and the view range is two squares, you have to duplicate the entity across 9 servers all the time. That means you need 10 servers just to get up to the capacity range of a single non-sharded server! The draw-back then is that you have a maximum density per area, and a minimum area size per server, which means your world has to spread out somewhat evenly. Because the server/server communication is "local" (only neighbors,) you can easily scale this to as large an area as you want, as long as players keep under the designated maximum limit. Many games have used methods similar to this (There.com, Asheron's Call, and several other.) The other option is to allocate by ID, or just randomly by load on entity instantiation. Each server simulates entities allocated to them. You have to load the entire static world into each server, which may be expensive if your world is really large, but on modern servers, that's not a problem. Then, to interact between other servers, each server broadcasts the state of their entities using something like UDP broadcast, and all other servers decode the packets and forward entities that would "interact with" entities that are in their own memory. This obviously lets you add servers in linear relation to number of players, and instead you are limited by the speed at which servers can process incoming UDP broadcast updates to filter for interactions with their own entities, and you are limited by available bandwidth on the network. 100 Gbps Ethernet starts looking really exciting if you want to run simulation at 60 Hz for hundreds of thousands of entities across a number of servers! (In reality, you might not even get there, depending on a number of factors -- Amdahl's Law ends up being a real opponent.) None of this is new. The military did it in the '80s on top of DIS. And then again in the late '90s / early '00s on top of HLA. It's just that their scale stops at how many airplanes and boats and tanks they own, and they also end up accepting that they have to buy one computer per ten simulated entities or whatever the salespeople come up with. There's only so many billion-dollar airplanes in the air at one time, anyway. For games, the challenge is much more around designing your game really tightly around the challenges and opportunities of whatever technology you choose, and then optimizing the constant factor such that you can run a real-size game world on reasonable hardware. (For more on single-hardware versus large-scale, see for example http://www.frankmcsherry.org/assets/COST.pdf )
45. 2 points

## A new Game Style

You have now entered the world of the developer, we are attempting to dispel the illusions that developers used on you. I know it sounds like we are being rude, the truth is that we want you to see past the lies s that your ideas can start to grow. First, that is like a air passenger saying that because he flew on a plane , he is ready to be a pilot. Once you start making games you will look at them with new eyes, you will start to see the truth. The same way a pilot flaying as a passenger would be able to tell to have some idea of what the other pilot is doing. Take for example light in games, each object is responsible for there own light; using a shader. All those lights you see in Unity is just a way to make light act more normal, a guide , nothing more than a illusion, they are just a way of defining a point where theoretically light comes from. If you remove all those lights it will only turn your scene dark, if you tell it to. Because you see your game has no rules or laws, unless they are defined. Yes, this will give you all the problems of networking and none of the solutions. That's the thing, people who code this part of the game spend years doing it. The answer doesn't just one day fall into your lap, they don't "reveal them self", you take the idea, break it apart and learn it bit by bit. If only this was true. Consider this: it takes a student four years to learn one of the skills needed for game development, then four more years to get really good at it with constant practice. So if one person planed on making a very high quality game, they would have to learn 8 years for graphics, 8 for animation, 8 for sound and spend 8 on programming. 8+8+8+8 = 64 years of there life learning, except there is a catch, if you don't constantly practice a skill it dulls. For that reason each person often masters one skill then practices others lightly. What am I getting at? Simple if your game looked nice in your dream and you want to be the one that makes it look that way, then you will need to become a artist and only do game design as a hobby. Or hire someone with the right skills to create that art instead, a interruption of your dream. Then there is how long games take to make, the AAA games you played, there average time is 2-3 years in production. These are games made by teams of over a hundred people working on each part. No one is going to steal your idea and remake it in a hour. Chances are everyone is to busy using there life to make there own games. So then lets see if we can find it then:
46. 2 points

## Horror AI

Start simple, make a monster that exists (and does nothing). Then gradually expand things in small steps: - let it walk around randomly - let it detect the player nearby - let the player know the monster found him/her (or maybe not, if you want to surprise the player) - pop up in front of the player (or whatever it should do to scare you).
47. 2 points

## [DirectX9 Bitmaps] Can someone help me out with a nullptr check?

Then it must be a typo, consider the following: struct Foobar { int x; void frobnicate() { cout << this->x; } }; int main() { Foobar* f = new Foobar {3}; if ( f = nullptr ) { // Compiler should warn about this line return -1; } f->frobnicate(); // This will always crash delete f; }
48. 2 points

## Help where to research for modelling nunchuk motion

I'm assuming you're talking about 3D; you're basically asking about physics-based animation. You might want to look at this: http://chrishecker.com/How_to_Simulate_a_Ponytail It's not quite nunchuks, but it will probably get you started. Also, not gonna lie... I haven't actually used that article to make anything... :-D But it looks like it's on point for what I gather you're trying to do.
49. 2 points

## Filling a rectangle with randomly chosen rectangles of specific size?

I don't know any algorithm, but my first thought is to start with the entire rectangle, and repeatedly split one rectangle in two, with a direction (horizontal / vertical), and an offset from eg top-left corner. You can play with several parameters, like throwing smaller rectangles out, or give priority to larger rectangles, or cut the longest direction. Hopefully you'll find a setup that gives nice results.
50. 2 points

## boost::asio causing seemingly random crashes

That doesn't sound quite right to me. If you use REUSEADDR and/or REUSEPORT, more than one socket can send from, and receive from, the same port number. The kernel will allocate incoming data to one of the sockets in some way that is not usually deterministic. However, nothing will "step on" anything else in this setup. It's totally supported by the kernel API and system libraries. Maybe what would be happening would be that one of your programs (client, for example) would send a message it thought was to the server, but the kernel would turn around and hand it right back to the client, who would then not process it correctly. If that is the case, and causes your program to crash, then your program has a remotely exploitable bug and running your game would expose you to possible shenanigans from the greater internet. No matter what kind of data arrives on a socket, and in what order, your program should never mis-process the data or crash. For random noise, you should detect that you don't know what the packet means, and stop processing it early. For packets that seem correctly formed but have the wrong "meaning," you should detect that they don't make sense in the context ("server packet received on client") and log the problem and ignore the packet. Similarly, if packets contain fields that are too short, or too long, for the intended usage, you should detect this, mark the packet as corrupt, and stop processing. If you ever let data under the control of a remote computer point your program at uninitialized data, or past the end of the packet, or into a part of your program that hasn't been initialized yet, your program has a remote code execution vulnerability.

1. 1
2. 0
3. 5
4. 0
5. 9
6. 9
7. 5
8. 3
9. 1
10. 9

1. 0
2. 0
3. 0
4. 0
5. 0
6. 0
7. 0
8. 0
9. 0
10. 0