Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 13 Sep 2012
Offline Last Active Today, 03:26 PM

#5209281 Article suggestions

Posted by TheChubu on 07 February 2015 - 11:20 AM

* OpenGL and Java - It is such a pain to get this working.  Mac, Windows, Linux, different versions, jar files and native libraries.  I think I spent two days trying to get a 3D display in our app at work.  Then I got home and found out I used the wrong GL interface and it wouldn't run on my Mac.

Really? I found LWJGL much easier to use than GLEW, freeGLUT and others.


Just downloaded the lib, link the natives in the IDE, and create a window (LWJGL 2 uses its own Display class, LWJGL 3 uses GLFW 3 to handle windowing). Got it working in Windows and Linux. No idea about OSX but it didn't supported OpenGL 3.3 for a long time so I didn't bothered much.


The only issue I had was an actual platform specific issue, you have to ask for 32 bit color in Windows and 24 bit color in Linux for the default framebuffer.


Although you could specify ways to handle what native libraries to load depending on the OS the user is running and things like that, LWJGL uses Java's Propertiy API to fetch a specific path if its specified.

#5208534 CoreCLR (.NET Core) in GitHub right now

Posted by TheChubu on 03 February 2015 - 09:56 PM

Well this is fun, here: https://github.com/dotnet/coreclr

#5208225 SDL2 and Linux [RANT]

Posted by TheChubu on 02 February 2015 - 11:24 AM

I think it's a little silly to be angry about a product which was provided to you to use for free.
Free software isn't above criticism. That you think that you have to pay for something for you to criticize it tells me more about you than about how silly the idea might be.

#5207954 Problem with FloatBuffer Object as a paramerer

Posted by TheChubu on 31 January 2015 - 04:34 PM

But this smart person would not highlight (quote) the exact flaws directly in 1 or 2 simple line's effort and show how to correct them (and thats the problem)

 Or you could you know, do the reasonable thing "I don't understand why do you say that I'm copying references needlessly, could you specify what you mean?" You making a thread doesn't automatically makes you worthy of anyone's time. Which means that you're the arrogant here, in case the point didn't get across. 


And you can easily Google Java's code conventions to see what he means.


Anyway, enough of this, I see a problem here:




Don't set the position back to zero, put stuff in the buffer, then call buffer.flip(). Buffers hold internally a position and a limit, the limit is what the OGL functions will use to know how far they have to read into the buffer. What you have right there is that limit still remains zero, since you never called flip().


Moreover, you're probably going to start leaking memory, Google around for direct buffers in Java (Android, whatever) and how to free them. They're memory outside JVM managed heap, and they're not guaranteed to be freed at any specific time, so its best if you free them yourself manually in a timely manner.


EDIT: And the editor fucked up the quotes again, *sigh*

#5207756 LGPL ugliness and LZMA

Posted by TheChubu on 30 January 2015 - 03:44 PM

You also need to allow the user to be able to drop in a new version of the lib and the intention to be for it just to work with the new version. Usually this isn't technically possible without recompiling as open source authors don't really think with backwards binary compatibility in mind.
That's why the reverse engineering part is there, because if it a drop in replacement doesn't works, user needs to be able to reverse engineer the application to make it work. It doesn't demands of you to keep it compatible forever.

#5207751 LGPL ugliness and LZMA

Posted by TheChubu on 30 January 2015 - 03:21 PM

What's wrong with LGPL?

Technically the annoying part is that LGPL needs for you to allow the reverse engineering of your software for the purpose of switching the LGPL library. Now, how much reverse engineering would need to be considered "enough" for that? That's the tricky part. 


You'd need to architect your code so the boundaries between the LGPL lib and the rest of the application are well defined and publicly documented. Otherwise people can claim they were reverse engineering your application for replacing the LGPL lib with another version and they just happened to come across say, your super secret map generation code, or your DRM routines.


Now, I haven't come across these things happening and its not like crackers first check if there is any LGPL licenced software being used before cracking an application. So I'm not going to say its something you really need to worry about, just have it in mind.

#5207267 Some programmers actually hate OOP languages? WHAT?!

Posted by TheChubu on 28 January 2015 - 02:44 PM

in other words, many of the things people call "typical C++ bullshit" or "typical OOP bullshit" is actually "typical Java bullshit" that's been drug into C++ by recent grads or Java refuges who don't know how to write idiomatic C++ and so write idiomatic Java in C++ instead.
Now that might be just me but it sounds awfully like a "dey took our jibs!" reasoning there. Must be those filthy Java programmers, et cetera. Also you seem to assume colleges teach "idiomatic Java", I'm going to tell you they don't. They teach generic OO concepts, often badly, no matter the language they end up actually using. 


I'd say that the main reason few people write "idiomatic" C++ is because C++ is an impenetrable mess rather than other languages having obviously spoiled your programmers. Moreover, "idiomatic C++" that takes advantage of all the features of the language guarantees the codebase will become an impenetrable mess. There is no such thing as "idiomatic C++", you can get as idiomatic as the subset of features your project limits itself to allows you to, doing anything else ends up in madness and despair.


Also, turns out that many of your so called "idioms" of C++ are actually beneficial for Java and for any language. Avoid heap allocations, avoid virtual function calls*, branching has a cost, pointer indirection has a cost, and so on. I agree with exceptions there, they're just annoying, then again I'd say exceptions are a big thing on "enterprisey" software, regardless of the language.


Now if these people don't even know generic beneficial idioms that would help them no matter the language, then I don't see why you would put that on Java's shoulders.


*Although this is specific to OO languages. Also there are Java-specific considerations here, JIT can inline the virtual call if it only sees one or two concrete implementations.

#5206809 FBO only renders to the first target

Posted by TheChubu on 26 January 2015 - 07:32 PM

. They aren't relative to each other for some reason in lwjgl 
They do are from what I've used in LWJGL 2.9.2 and LWJGL 3. They take the values directly from OGL headers.


This is from LWJGL 3:

GL_COLOR_ATTACHMENT0        = 0x8CE0, // Thats 36064
GL_COLOR_ATTACHMENT1        = 0x8CE1, // 36065
GL_COLOR_ATTACHMENT2        = 0x8CE2, // 36066
... etc

#5206766 Why is this taboo?

Posted by TheChubu on 26 January 2015 - 03:31 PM

Because it is very well known that 2D platformer protagonists absorb vital energy from mystical roasted turkeys found deep inside the foundations of old castles.

#5206603 Best way to source and organise a massive Objects interaction

Posted by TheChubu on 25 January 2015 - 02:35 PM

Yes, this is potentially a huge project and there will be a team of people working on it. Do you know of standard software that does some or most of such a job? There are muliplayer games out there that do this eg Second Life so do they write from scratch or use standard products as a base?

You'll have to go with a commercial engine probably, like Unity or Unreal Engine 4. You won't be able to use visual basic with them as far as I know though.


Otherwise it will go well beyond 50k lines. Take an example, Quake 3 Arena, pretty old game, released in 1999. Basic physics, no interaction with the environment, very few players per map, all there is for the player is to jump and shoot, its around 300k lines of C. Minecraft is a bit over 300k lines of Java (although unlike ID's stuff, it isn't a landmark of good videogame code). Big commercial modern engines like UE4 or Unity go beyond 1 million lines of code mark.


3. Each object has Methods (ready made or deduced by the Genetic Programming algorithm in the program) which allows it to interact with the other objects
4. The user can then either just let it run to observe what happens (Simulator mode). Or it can solve problems eg "How can the man escape the Lion?"

Yes but you need to pin point exactly what kind of interactions are we dealing here because you'll have to code each of them. Man escaping the lion requires a man to be animated, a lion to be animated, a man AI, a lion AI, etc.


If the action is "push an object" that's easier if you have a physics engine, if the action is "pick up an object" it could be as hard as having to animate the player picking up the object, rigging the object to the player, or just making the object disappear and list it on a player inventory.


And that's like that if you already have an animation system, physics engine, rendering engine, AI system, inventory management, textures, models, animations, loaders for all of them, and a big ass et cetera. Otherwise you'll have to code it all.


I assumed that in many Games this is what the designer would do ie download ready made objects for the players to interact with.
Stock objects downloaded and used as-is are pretty much frowned upon (much like direct unmodified sampling in songs). Designing the look of a game takes time, and maintaining that style pretty much demands assets to be made specifically for each project, or at least tweaking of existing assets so they don't look off. All of this doesn't just requires effort but also having people in the team with good art skills.

#5206432 Best way to source and organise a massive Objects interaction

Posted by TheChubu on 24 January 2015 - 01:12 PM

A. The best source of objects and environments
B. The best language to use with vb.net to manipulate objects in 3D and enable them to interact
I have no clue what you mean. At all.


"source of objects and enviroments" ? What? What do you mean by "objects" ? What do you mean by "enviroments" ? What do you mean by "source" ?


"enable them to interact" ? You need to specify exactly what kind of "interaction" are we talking here, what kind of "manipulation" you want.

#5205902 OpenGL to DirectX

Posted by TheChubu on 21 January 2015 - 08:04 PM

But if you want the highest of the high level of graphics, super AAA quality rendering, then OpenGl is inferior. Maybe the latest version is great, but the ones I tried were a lot behind. For starters, a big chunk of OpenGL is implemented in the GPU driver. There is a huge quality gap between supper cheap GPUs never meant to do real rendering work and high quality stuff.
[citation needed]

#5205800 OpenGL to DirectX

Posted by TheChubu on 21 January 2015 - 10:47 AM

i look for Introduction to 3D Game Programming with Direct3D 11.0 by frank de luna, but it's all about rendering.

It happens that's all you'll use D3D or OpenGL for. They're rendering APIs, they don't handle collisions, they don't handle animations, you have to implement those, then draw them appropriately with the API.


I really want to learn DirectX first but I cant find any good tutorial that actually make a simple 3d game

 That is because making a "simple 3D game" from scratch isn't tutorial material, its book material. 3D games aren't simple.


I wont chime in the D3D or GL first debate, but I'll say that if you go the D3D route, start with D3D11, if you go the OpenGL route, start with OpenGL 3.3 or higher.


EDIT: Fuck the editor. Now it messes up quote blocks too. Ugh...

#5205798 Javascript/C++ Combo Questions (Networking/Tools)

Posted by TheChubu on 21 January 2015 - 10:39 AM

Or is this bad practice that I change later?
If you do it in JS and then change it to C++, it isn't "bad practice", that just means requirements weren't what you thought they'd be. Its fine, it happens, and the next time you have to implement something related, you'll know the right answer.

#5205103 Download Library of 3D models.

Posted by TheChubu on 18 January 2015 - 12:33 PM

My environment Code: Blocs, which also imposes certain conditions.
That have nothing to do with the code itself.


Calls will be exactly the same using Visual Studio, Code::Blocks, Xcode, QtCreator, or an hex editor and lots of patience. Code will be the same. The only thing that will differ is the menus for linking the libraries to your project.