Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411489 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 03:20:30 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The grumpy old programmer room
Pages: 1 ... 239 240 [241] 242 243 ... 295
Print
Author Topic: The grumpy old programmer room  (Read 738658 times)
lithander
Level 3
***


View Profile WWW
« Reply #4800 on: May 01, 2015, 11:00:20 AM »

It is also not really correct to include it unless a constant acceleration due to gravity is the only acceleration you are modelling.

Well you could use F * t + 0.5 * F * t^2 for all constant forces and for non-constant forces you don't. Usually if it isn't a constant force you can model it as impulses (delta_v * m) which means change in velocity per tick. Which is usually what you want for collision response etc, right?

Regarding choice of integrator (Verlet, Runge-Kutta, Euler) I've reading very contradictionary opinions. It would make an interesting discussion to discuss pro's and cons. Personally I think Euler is fine for practical purposes.
Logged

Boreal
Level 6
*


Reinventing the wheel


View Profile
« Reply #4801 on: May 01, 2015, 12:08:39 PM »

Euler is "fine" for many purposes, sure.  But when you start adding degrees of freedom and more objects it becomes prohibitively expensive to reduce the timestep enough to maintain accuracy, which is very important when you're also making a multiplayer game.  This is when you switch to a more accurate integrator.
Logged

"In software, the only numbers of significance are 0, 1, and N." - Josh Barczak

magma - Reconstructed Mantle API
lithander
Level 3
***


View Profile WWW
« Reply #4802 on: May 01, 2015, 12:35:04 PM »

Euler is "fine" for many purposes, sure.  But when you start adding degrees of freedom and more objects it becomes prohibitively expensive to reduce the timestep enough to maintain accuracy, which is very important when you're also making a multiplayer game.  This is when you switch to a more accurate integrator.

More accurate but also more expensive to calculate. I'm sure it depends on the actual usecase but what I mean with "fine" is that I can't come up with a scenario from my personal experience where Euler didn't suffice. I mean even in physics engines euler get's you a long way. See this GDC talk for example: http://www.gdcvault.com/play/1018160/Physics-for-Game Page 30

Quote
The simple update rules for applying gravity and velocity are called Euler integration.[...] There are more complicated integrators available, but they don’t do well in systems with discontinuous changes like rigid body impacts. Also, even though these integrators are more accurate, in games we generally value stability and speed more than accuracy.

It's not a matter of "RK4 is more complicated but I'm a pro and so I'll opt for the best solution because I can" imo. Do you have a specific scenario where RK4 (or Verlet Integration) got a job done that Euler (at let's say 60hz) didn't?
Logged

Sik
Level 10
*****


View Profile WWW
« Reply #4803 on: May 01, 2015, 01:10:47 PM »

I hope some day another systems language picks up steam because compile times in C/C++ are archaic

Eh, C is pretty quick to compile actually. The problem with C++ tends to be anything involving templates, since there's the potential of a whole new type being generated at any time, with everything it implies.

Also yikes I haven't checked this thread in ages.
Logged
Boreal
Level 6
*


Reinventing the wheel


View Profile
« Reply #4804 on: May 01, 2015, 01:29:30 PM »

It's not a matter of "RK4 is more complicated but I'm a pro and so I'll opt for the best solution because I can" imo. Do you have a specific scenario where RK4 (or Verlet Integration) got a job done that Euler (at let's say 60hz) didn't?

I didn't mention this before but yes, stability is also a key part of game physics engines.  It's surprising that they would imply Euler is more stable than other integrators, since it doesn't conserve energy and it's still an explicit solution.  Orbital dynamics should use Verlet to avoid losing energy, and cloth systems should use an implicit solution to avoid blowing up.  Rigid bodies should use RK4 since it's more accurate.  Euler is in the same camp as RK4 except you can gain a bit of performance for a massive accuracy tradeoff.

Disclaimer: I'm very infatuated with simulation-style games so this is why I'm so opposed to Euler integration.  I'd rather have an accurate game and lose the shitbox market.
Logged

"In software, the only numbers of significance are 0, 1, and N." - Josh Barczak

magma - Reconstructed Mantle API
InfiniteStateMachine
Level 10
*****



View Profile
« Reply #4805 on: May 02, 2015, 10:32:37 AM »

I hope some day another systems language picks up steam because compile times in C/C++ are archaic

Eh, C is pretty quick to compile actually. The problem with C++ tends to be anything involving templates, since there's the potential of a whole new type being generated at any time, with everything it implies.

Also yikes I haven't checked this thread in ages.

Once you get into massive codebases C still hurts relative to other languages such as Java and C#, unfortunately those languages are not system language replacements. Templates do suck a lot for compile times but they are only a small part o the overall problem.

D in particular I've heard a lot of good things about the massive compile time speed up.

Anyways I'm glad that there are computer scientists out there who have taken a renewed interest in making a better systems programming language. From a build time standpoint and just a general language improvement standpoint.
Logged

MorleyDev
Level 0
***

"It is not enough for it to just work"


View Profile WWW
« Reply #4806 on: May 04, 2015, 04:18:40 AM »

Imagine you professionally produce web-based 'static' 'offline' HTML+Javascript software for enterprise clients (need to run in a web browser, but must be entirely self-contained and client-side), including banks. Imagine a lot of those banks still had IE6 as a minimum browser. Imagine all of those projects use a common core of code that needs to work on all the crazy browsers enterprise clients can come at you with.

Sure would love to be able to use some of this new ECMAScript 6 I keep hearing of (outside of what I can polyfill because using ECMAScript 6 Promise in IE6....well, actually works). Heck, ECMAScript 5 is only usable because of the sheer volume of polyfills out there.

Hmm, wonder if I can convince people at work to switch to Typescript...
« Last Edit: May 04, 2015, 07:35:45 AM by MorleyDev » Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #4807 on: May 04, 2015, 02:40:37 PM »

Imagine you professionally produce web-based 'static' 'offline' HTML+Javascript software for enterprise clients (need to run in a web browser, but must be entirely self-contained and client-side), including banks. Imagine a lot of those banks still had IE6 as a minimum browser. Imagine all of those projects use a common core of code that needs to work on all the crazy browsers enterprise clients can come at you with.

Sure would love to be able to use some of this new ECMAScript 6 I keep hearing of (outside of what I can polyfill because using ECMAScript 6 Promise in IE6....well, actually works). Heck, ECMAScript 5 is only usable because of the sheer volume of polyfills out there.

Hmm, wonder if I can convince people at work to switch to Typescript...

I've heard the term polyfill a ton but never knew what it meant. Finally looked it up.

Interesting, and gross at the same time :D

I certainly enjoyed typescript a lot the limited time I used it (I was playing around with DurandalJS, now called Aurelia)
Logged

Boreal
Level 6
*


Reinventing the wheel


View Profile
« Reply #4808 on: May 12, 2015, 09:22:45 AM »

I'm writing a Mantle library with reconstructed headers and a function pointer loading mechanism.  The GitHub repo is in my signature if you're interested.

It's going mostly smoothly except for one bug I've just encountered - grWsiWinGetDisplays complains that the array of GR_WSI_WIN_DISPLAY primitives is of zero size.  I encountered problems similar to this before, but it turned out they were due to a calling convention mismatch with the 32-bit DLL.  I switched to the 64-bit DLL, which worked fine, but now this is happening and I have no clue where it's coming from.
Logged

"In software, the only numbers of significance are 0, 1, and N." - Josh Barczak

magma - Reconstructed Mantle API
InfiniteStateMachine
Level 10
*****



View Profile
« Reply #4809 on: May 12, 2015, 03:01:55 PM »

Got bit in the ass again by clang.

This time it was totally my fault though. What I was doing wasn't in the standard. 
Logged

phosphorous
Level 0
**



View Profile WWW
« Reply #4810 on: May 12, 2015, 10:33:35 PM »

Hnngh. I've spent like 8 hours trying to make the fog-of-war in my game to a post-processing effect. It was supposed to be just a quick improvement, but it turned out to not be so simple. Struggled to get the world position reconstructed from the depth buffer properly. Finally have it working, game looks exactly the same, no noticeable improvement in performance, much time spent for not much visible results... Cheesy

Okay there is the benefit that now I can use any shaders and they will be affected by the fog-of-war, previously I've had to use specialized shaders for everything. Also now I could do better blending and perhaps more advanced occlusion effects.

In case anyone is interested the whole thing works like this: its a tile-based game with X amount of player units who each have a view area that needs to be combined to the overall view, which is stored in a texture (each pixel corresponding to a tile, white for revealed and black for hidden tiles). The line of sight calculations run on a separate thread which updates the texture for those units that have updated their view. Finally the fog-of-war texture is passed on to the post-processing shader where the world position is reconstructed and the correct tile looked up from the fog-of-war texture. Then the shader just multiplies the color with the fog-of-war value so everything gets nicely shaded.
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #4811 on: May 20, 2015, 03:20:08 PM »

In case you ever need to custom build Boost. For example because you need boost-locale which is not useless on Windows. The default WinAPI backend for boost-locale fails on basic encoding conversions, for example.

So here's the way:
Code:
- Download ICU 32bit and 64bit, the prebuilt Visual Studio 2010 packages
- extract both into the same directory
- go to both lib/ and lib64/ and duplicate all *.lib to *d.lib, or otherwise boost ICU detection fails

for 32bit
- run Visual Studio x86 Native Tools-Command line
- go to boost_1_58_0 directory
- bootstrap.bat (once, if not done before)
.\b2 variant=debug,release link=static address-model=32 --stagedir=stage32 -sICU_PATH=C:\Path\To\icu

or for 64bit
- Visual Studio x64 Native Tools-Command line
- go to boost_1_58_0 directory
- bootstrap.bat (once, if not done before)
.\b2 variant=debug,release link=static address-model=64 --stagedir=stage64 -sICU_PATH=C:\Projekte\icu

Figured I googled it so often now it's time to share it, so maybe Google picks it up easier.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #4812 on: May 21, 2015, 07:22:12 AM »

This belongs in the beautiful fails section of the forums.

EDIT: What I was talking about has since been moved, please disregard this message.
« Last Edit: May 21, 2015, 12:21:01 PM by ProgramGamer » Logged

Sik
Level 10
*****


View Profile WWW
« Reply #4813 on: May 21, 2015, 09:30:42 AM »

Reminds me of the "when your OS goes crazy" thread in the OSDev forum (did the program seriously print itself? XD)
Logged
Sixmorphugus
Level 0
***


._.


View Profile
« Reply #4814 on: May 21, 2015, 09:49:50 AM »

This belongs in the beautiful fails section of the forums.
Apologies, I've moved it.
Logged

There's no place like 127.0.0.1.
Dacke
Level 10
*****



View Profile
« Reply #4815 on: May 27, 2015, 09:09:18 AM »

Could someone over in the US fix the political system, please?
http://arstechnica.com/tech-policy/2015/05/white-house-sides-with-oracle-tells-supreme-court-apis-are-copyrightable/
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #4816 on: May 27, 2015, 11:21:53 AM »

Why do they get to decide this? Why don't they form a committee of experienced programmers from many different backgrounds to decide these things instead of uninformed law people?
Logged

Dacke
Level 10
*****



View Profile
« Reply #4817 on: May 27, 2015, 12:49:00 PM »

Usually committees are formed by selecting loyal people from the biggest commercial institutions. So you'd end up with a very similar problem, where the people on the committee would be just as corrupt. It's not a matter of justice nor democracy, as the system currently works almost every issue is a matter of commercial interests.
Logged

programming • free software
animal liberation • veganism
anarcho-communism • intersectionality • feminism
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #4818 on: May 27, 2015, 02:19:39 PM »

You guys needn't be so pessimissitic. I'm not a lawyer, or even American. But at least I read the article.

The Federal Administration *doesn't* decide this. They've just issued an opinion, which the Supreme Court may or may not follow. Lots of people can submit an opinion - the EFF did via an amicus brief, for example. So it's hard to call the Supreme Court uninformed when they have essentially unlimited "expert witnesses".

The Supreme Court is made of judges, it's not some ad hoc committee of corporate shills (though there are still some problems of ulterior motive, naturally). Also, the Supreme Court isn't lawmakers. As I understand it their job is to interpret the existing laws (sometimes setting precedents for consistency).

Finally, it's not at all obvious to me experienced programmers would be a good group of people to decide anyway. You need to predict of the consequences of deciding one way or another, and interaction with other laws and countries. This is not an engineers skillset. The actual technical aspect is pretty small, and could easily be explained to laypeople. You sound like that venerable philosopher Plato, who thought that naturally, philosophers would make the best kings.

edit: s/Justice Department/Supreme Court/.
« Last Edit: May 28, 2015, 01:07:57 AM by BorisTheBrave » Logged
ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #4819 on: May 27, 2015, 02:22:42 PM »

I admit my defeat, I was wrong in saying programmers would automatically do a better job than law people. But people with a background in both domains, as rare as they are, would be the best people to decide.

Also shame on me for not doing further research.  Embarrassed
Logged

Pages: 1 ... 239 240 [241] 242 243 ... 295
Print
Jump to:  

Theme orange-lt created by panic