Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Sep 2012
Offline Last Active Today, 06:02 AM

#5169987 Either I'm feeling burnt out or losing sight

Posted by TheChubu on 29 July 2014 - 03:23 AM

What I've noticed is the Doom 3 engine uses a lot of macros definations and HPL 1 Engine uses a lot of macros. I thought you want to stay away from macro definations as best as you could?
Have in mind ID Tech 4 (ie, Doom 3 engine) was started 15 years ago, and was ID's first incursion into C++. Up to that point, all of ID code was done with C and x86 assembly if needed. So "modern" code conventions might not adjust well to that codebase.


Then again, a more "modern" version of that codebase is Doom 3 BFG's engine, I hear it was modernized a lot with ID Tech 5 code and its focused on multi threading. Its open source and uploaded to github if you want to take a look.

#5169704 OpenGL learning methodology

Posted by TheChubu on 28 July 2014 - 03:59 AM

I say: Go with shaders. Fixed function pipeline OpenGL is pretty darn old, shaders are nice, you can do cool stuff with them. "Modern" OpenGL is nicer to use too (ie, OpenGL 3 and up).


How have you started?

I started with OpenGL 3.3, basically with barely any knowledge about C++ (or OOP in general) and a kinda basic idea on linear algebra (linear systems, basic transformations). So I just banged my head against it again and again until stuff started to make sense. Wouldn't you know it, after a while you start to Google around for stuff you want to make yourself instead of reading some tutorial that says what you have to do.


I started here http://www.arcsynthesis.org/gltut/ reading it again and again until the concepts started to sink in. I'm not a big fan of C++ so I didn't invested much time programming at first, rather I poked at the example sources. After a while I was getting the hang of it so I started implementing things in my language of choice, and started to build up from there. First project was drawing a triangle to screen, second project was drawing an entire heightmap to screen with a flying camera, then added directional lighting and basic "stick to the ground" navigation, then I had a break from graphics and now I'm back at it trying things I haven't done before (deferred renderer, other kinds of lighting, texturing, specular, etc).


At least in my case I didn't needed a full book to start with, nor for a long time. That online book I linked was enough to get started. Right now I do have a 5th edition Red Book when I need to look for specific things, since now at least I have an idea on what to look for. For many things I've also asked here in the chat, various knowledgeable people log in from time to time and its excellent when you need fast "yes" or "no" questions answered (which otherwise lead you to a lengthy revision of an entire chapter on the subject if you looked at a book just to find that one thing you're trying to do).


What do you think is important?

Jumping straight to what you want to do. If you have a clear goal on what you want to do, half the time the "step by step" procedures to learning something can get tedious. Some might tell you "Oh, you first start with fixed function to get your feet wet, then you can see a little of 2D graphics, then you can start with 3D graphics, then you can move on to shaders, then..." And so on.


If you're determined to do one of those things specifically, jump right at it, otherwise you might lose interest in the whole thing along the longer road.


EDIT: Oh and learning with video tutorials is slow as snails. Reading is more cost effective, in my case at least.

#5169380 Paint method not called

Posted by TheChubu on 26 July 2014 - 04:02 PM

I'll add that paintComponent() doesn't always get called. It only gets called when the widget (panel, frame, button, etc) needs to be repainted (say, window was resized, button was pressed, etc), otherwise it won't get called.


If you need a component to be redrawn at some point, there exists the "repaint()" method in Swing widgets to achieve that.

#5168818 Weird Syntax Tricks

Posted by TheChubu on 24 July 2014 - 01:30 AM

"This code is auto-generated. Do not modify it. Your changes will be discarded next time it is generated." That always keeps people out.
"Hey look! This dude made a hack generator, he must be a genius!"

#5168011 Why Java games do not need installation

Posted by TheChubu on 20 July 2014 - 03:30 PM

I never thought about this until now. The Java games I developed never need the installation treatment.
That only tells me your games aren't complex enough to require an installation procedure.


What happens if you want someone to play your game in Windows, and want your program installed in Program Files, with a Start-> programs menu, a desktop icon, and an uninstaller, wouldn't that need a dedicated installation procedure? Regardless of your game being made in Java, C or Haskell?

#5168007 Is there an easier way?

Posted by TheChubu on 20 July 2014 - 03:12 PM

Yeah about that, I'd say just figure out the basics (what classes do you need) first. Serialization/deserialization isn't always a nice topic.


In any case, what you will be looking for (after figuring out the basics) is for JAXB probably. Its the standard way in Java to go from XML files (what Fell described) to objects and vice versa. Java has tons of "standard" frameworks for doing all sort of things, this is one of those things that are in the standard library that comes with all JVM installs (thus, not necessarily in Android).


If XML isn't for you, there are other markup languages to use like JSON or YAML, I *think* Java standard library supports serializing objects to a JSON file, not sure, for using YAML you'll have to use an external lib like SnakeYAML, there are probably external libs for JSON too.


But, as I said, first your class design, later you can figure out how to store/modify/load that data.

#5167824 Is there an easier way?

Posted by TheChubu on 19 July 2014 - 12:27 PM

Don't store everything in strings, its error prone, bloats the data, and string comparison is relatively expensive.


Stats are the same for all pokemons, so you could just have a bunch of fields for strength, agility, endurance, etc. Moves themselves could be regular objects with modifiers, the modifier itself could be an object that takes a pokemon and applies some effect to it. So you'd have health modifier, stat modifier, etc. Also, not all pokemon can learn all the moves, so you'd have to store that knowledge somewhere (either each move can know what pokemons can learn it, or each pokemon knows what moves it can learn).


A pokemon would have its stats, and a list of 4 moves, each of them having their own modifiers (which could be one or more, say, damage + poison).


You can serialize all of that data as Fell mentioned later for easy modification.

#5167180 Procedural Animation in a MMO?

Posted by TheChubu on 16 July 2014 - 10:38 AM

It depends.

#5167161 Need pointed in the right direction

Posted by TheChubu on 16 July 2014 - 09:12 AM

Sorry but Java doesn't supports pointers biggrin.png



(also, read the links Avalander gave you)

#5166446 Javascript Won't Run with Tutorial GitHub Code

Posted by TheChubu on 12 July 2014 - 01:10 PM

Just one thing: Java != JavaScript

#5165690 c++ help

Posted by TheChubu on 08 July 2014 - 05:34 PM

I'll explain.

Upvote for Seinfield.


EDIT: Totally unrelated comment I know, give me a break.

#5165505 Bad Performance On Intel HD

Posted by TheChubu on 08 July 2014 - 03:55 AM

. I do have a lot of draw calls, maybe instancing could help me (but my fear isthe intel hd "says" it supports d3d11
Are you sure that isn't just Windows 7 reporting it has DX11? (as in D3D11 installed but feature level 10_1 supported).


Intel site says it supports up to DX10.1 only. http://www.intel.com/support/graphics/sb/CS-033757.htm (under 2nd generation).

#5164904 Specular Mapping in Deferred Rendering

Posted by TheChubu on 05 July 2014 - 11:13 AM

Now each normal fits into 8 bit unsigned range, and using that other compression trick I mentioned (again, you better read this up yourself) you have two additional 8-bit channels that are unused, where you can store other stuff like shininess etc...

Hm, wouldn't that increase the visual artifacts quite a bit?


I've seen Killzone 2 slides where they say they use two 16 bit floats to store X,Y, then reconstruct Z. Or Battlefield 3 slides where they say they use RGB8 and just store XYZ in it. I never saw something from a game using both methods at the same time.

#5164856 FBO Questions

Posted by TheChubu on 05 July 2014 - 05:08 AM

The hardware depth test has certain optimizations in place which can significantly speed up the rendering of occluded fragments.
This. Have in mind that writing directly to the depth buffer means no early Z rejection. The GPU can "preemptively" reject fragments before executing the fragment shader by just testing the resulting depth value from the vertex shader outputs.


If you write to the depth buffer directly, the GPU has to execute the fragment shader to know the actual depth value, thus no early Z rejection is possible.


If that worries you, you can always measure the differences between the possible methods.

#5164837 So... I'm a Molecular Biologist....

Posted by TheChubu on 05 July 2014 - 12:21 AM

What I'm trying to be able to do is communicate what I want to a programmer using the correct terminology. [...] I figure I would try to get the game coded in C++ and for mobile devices,
Hm... So you're basically saying, you want a programmer to code up your game idea?