Jump to content

  • Log In with Google      Sign In   
  • Create Account


darookie

Member Since 17 Sep 2001
Offline Last Active Aug 17 2013 07:29 PM

#5048858 Are graphs a good way to manage big terrain scenes?

Posted by darookie on 01 April 2013 - 06:42 AM

Just to nitpick a little - trees are graphs. Acyclic directed graphs to be specific wink.png Regarding your question, it is probably not a good idea to stuff every kind of information you need into a single data structure. Rendering requires a different graph (tree) structure and data to be efficient than path finding or collision detection. Your initial scene graph may contain all the required data, but for real time use it's best to split that data up into separate layers (render nodes, path finding nodes, collision information, objects, etc.) and data structures that are optmised with regards to their respective usage.

 

Yet another thing to consider is the way your data will be used in general. A streaming file format and data structure has different requirements from a static graph that is loaded once (like using zones for larger patches of terrain). A http://en.wikipedia.org/wiki/Quadtree might provide a relatively simple way of subdividing larger scenes into smaller parts. It can be pre-calculated in an offline step so your heightmap can initially be quite large. By storing the tree in a linear fashion to a file and using an index into each level of the tree you can then easily locate and deserialise the data you need at runtime if you need to.

 

HTH




#5038421 Directx8 error LNK2019: unresolved external symbol PLEASE HELP!

Posted by darookie on 02 March 2013 - 08:40 AM

The remaining errors are a result of interface changes in the ID3DX library between your installed version and the one the core_graphics implementation was built upon.

UpdateSkinnedMesh() should take 3 parameters and be used like this:

UpdateSkinnedMesh(matrix, NULL, mesh), where matrix points to your bone transform matrix and mesh is your mesh pointer.

 

I don't know the parameters for GenerateSkinnedMesh(). As a rule of thumb, however, you should never just throw in NULL parameters at random. Instead, take a look at the parameter types the function expects and match the variables that are used by the old code against them. Any parameter of the function that is not used by the existing code can be NULL (if it's a pointer).




#5038368 Blender units to directx units?

Posted by darookie on 02 March 2013 - 04:57 AM

There is no such thing as "directx units". If you model a unit cube the exported cube should be a unit cube as well. Any perceived difference in scale is therefore a result of either scaling by the exporter or simply different camera settings in Blender and your application. The former can easily be checked by examining the vertices of the loaded model.




#5038363 Directx8 error LNK2019: unresolved external symbol PLEASE HELP!

Posted by darookie on 02 March 2013 - 04:46 AM

Start by actually reading what the linker is trying to tell you:

The last error for example tells you about a missing implementation of the Run()-Method in the class cApp. A quick look at your main code confirms this - you need to implement cApp::Run() there.

The other linker errors have nothing to do with DX8 or DX9 either - you simply seem to have forgotten to include a bunch of cpp files in your project. All those missing methods the linker is telling you about are implemented in source files that are not part of your build. That's what you need to fix.

You should also just include either dx8 or dx9 libs - not both (e.g. get rid of the #pragma comment(lib, "d3dx9.lib"), #pragma comment(lib, "d3dx9d.lib") and #pragma comment(lib, "d3d9.lib")).




#5038357 Inline assembly

Posted by darookie on 02 March 2013 - 04:30 AM

It might be embedded to the code of the program, making it not complain when you run it...

Since string literals in C are not marked as executable it's much more likely that DEP is simply not enabled for all programs.




#4984973 SFINAE equivalent in C#?

Posted by darookie on 29 September 2012 - 12:54 AM

One must also keep in mind that generics are not at all equivalent to C++ templates or even Java generics (type erasure!). Some of the major annoyances with the platform have just recently (.NET 4) been fixed (like co- and contravariance issues with generic collections and enumerations).


#4977970 Languages used for game and software development on Windows, Linux, Android,...

Posted by darookie on 08 September 2012 - 07:39 AM

However, this mentality of developing software using platforms like .NET and Java because it is "easier" really needs to disappear if we as an industry are to progress. The C# language in particular really needs to die. It was marketed very well by Microsoft and was embraced by developers when it actually offers nothing beyond what Java had (un)provided for years. Unfortunately demonstrating how easy it is to sway the direction of technology. (if it wasn't for this, we could have had some awesome C++ libraries by now simplifying development for newcomers in a correct and innovative manner).

Just a side note on your ramblings. At the end of the day, all that counts is productivity and getting things done. Programming software is difficult enough as it is and there is no reason to burden the programmer with implementation details when an alternative programming language (tool!) allows him or her to focus on the actual problem at hand.

You seem to have a very skewed idea of "progress". Progress is not adding library xyz to programming language foo just to be able to achieve the same that another language features natively (either as part of the core language or its baseline runtime environment). Progress is to explore and discover means of being more productive, less error-prone and able to cope with the increasing complexity that software requires today and perhaps even more so tomorrow.

Ideology is nothing but a hindrance for true progress. A programming language is nothing but a tool. Knowing and promoting only one tool not only limits your choices on approaching a problem (both mentally and technically), and makes you inflexible when it comes to being to productive (i.e. regarding prototyping).
Innovation needs room for new ideas and living in a one-programming-language-box doesn't provide much of that. Finally, just to counter your argument from ignorance that C# has nothing to offer that Java had for years - one word: LINQ, oh - and DllImport, hm, maybe the unchecked and unsafe blocks, lambda expressions, etc. etc.

Bottom line: Learning more than one programming language is not a waste of time and statements like "language/platform xyz has to die because it hinders progress" are simply both untrue and quite offensive to the hard working, dedicated and bright people that created them. There is no silver bullet. Period. Posted Image


#4973920 Import texture/animtaion data

Posted by darookie on 27 August 2012 - 04:00 PM

Unfortunately most of the utility functions for loading models has been removed from later versions of the DirectX-SDK. The main reason is that developers tend to use their own model formats that best fit the requirements of their gfx engines, frameworks or digital content tool chains.
Internal tools have therefore been dropped due to lack of developer interest and conflicting requirements. A scene format like Adobe FBX for example might be rather feature complete and efficient for complete scenes, but is unsuitable for streaming data (like in large open world type games). Streaming data formats on the other hand depend on the target medium (SSD server disks vs. slow optical media on consoles, and so on) and the clustering of the data.

In short, there are a bunch of libraries and SDKs (like FBX mentioned above) that provide fairly complete access to model and scene data, but loading these formats directly using the Direct3D API is often unavailable, because the process depends on the architecture and implementation details of your rendering system. Thus, most implementations provide an abstraction layer that lets you access all aspects of the serialised data, but leave the rest to you.


#4973442 Import texture/animtaion data

Posted by darookie on 26 August 2012 - 04:23 AM

Since you are not interested in pre-existing solutions, here's a path that might be worth exploring.
First you'll want to export your model data in a format that is well defined and -supported by the digital content creation tool of your choice. In other words, try to stay away from the tool's proprietary format and save your assets as COLLADA files for example.

Next you need to identify the exact data that you need to render your scene and specify the exact memory layout that your renderer requires (e.g. index data width, vertex format, texture format, etc.) and convert the COLLADA files to a binary package that can be processed by your renderer without any further pre-processing.
Ideally, you'll structure the binary data in such a way that the parameters to your CreateVertexBuffer or CreateTexture2D calls are actually stored directly in the data file.
Using an intermediate format such as COLLADA has the advantage of allowing you to tweak your actual converter while leaving the actual asset unchanged and relieves you from the burden of writing custom exporters for your content creation tools, which in addition to the time required to get used to the SDK, is just another potential source of errors.

However, being new to GameDev I would strongly suggest to use existing libraries and tools first. Trying to roll your own tool chain for asset processing shifts your focus from actually creating a game to creating tools which, depending on your goals, might just be in the way of actually finishing a game. There's nothing wrong with using .X files and all rendering packages that I'm aware of have exporters available. You'll have plenty of opportunities to to create your own tools after you gained some experience in actually creating games, but YMMV.

HTH


#4971090 Help Planning for a Beginner, Wall of text

Posted by darookie on 19 August 2012 - 06:32 AM

C++ is regarded as being the "best" language for game development because that's what AAA game studios use. They really have to use C++ though because speed is critical in those situations.

I'd argue that this is not even the most important reason. The existing code base that companies spend hundreds of person years developing is a reason that is not to be underestimated. No big studio wants to throw their most valuable assets away just to gain some productivity. Yet another big plus for C++ is the relative ease of creating portable code. The C++ toolchain is available for consoles, PCs and smart phones, while other programming environments might not (or at least not "out-of-the-box").


#4971070 What was your path?

Posted by darookie on 19 August 2012 - 05:15 AM

  • Being faced with a random problem (say: writing a simple text adventure)
  • Looking at the options I have available (I started with BASIC on a Commodore 16)
  • Learned how to use the tools to achieve my goal
  • Tried to improve my skills by learning some theory (I started looking at algorithms like bubble sort, insert sort and data structures, etc.)
  • Bought a lot of shareware- and technical disk magazines (this was way before the internet) and looked at other people's code - now it's the internet.
  • Learned new languages (namely C and later Pascal), because they were used by many people in these disk mags
  • Added the new languages to my "toolbox" and tried to figure out what they were especially good at
  • Went back to Step 1 and repeated this cycle ever since.
My current skills include a wide range of languages with varying degrees of current working knowledge (from domain specific ones such as SQL, XPath, XSLT, IDL and regular expressions to general purpose languages such as C++, ARM assembly, C#, Java, F#, Ruby, Pascal/Delphi, Javascript, ...). Lately (for the past 8 or so years, that is) I added a Step 7a to the cycle - acquiring more in-depth knowledge on some language features like implementation details, to better understand how the language works and why.


#4968736 C# List<t> problem when adding Classes to it

Posted by darookie on 12 August 2012 - 09:52 AM

I don't understand what you mean by "unique name". Each new entry in the list can already be identified by its list index, which is by definition unique with each list (e.g. no two separate instances can have the same list index at the same time).
If you need a way to identify list items given only a reference, you can always add a property to your class like a time stamp or just use the list index:
[source lang="csharp"]// 1) Unique name using time of instantiationclass Market1{ public Market1() { Name = dateTime.UtcNow.Ticks; } long Name { get; private set; }}// 2) Unique name using list index (example only works for single list per class type)class Market2{ // here the constructor not only assign the name but also adds the instance to the list public Market2(IList&lt;Market2&gt; list) { Name = list.Count; list.Add(this); } int Name { get; private set; }}[/source]


#4968632 Headfirst program doesn't run in cmd

Posted by darookie on 12 August 2012 - 01:29 AM

That is to be expected. Javac is just the compiler that generates bytecode from your program. You can execute the program using the java command.


#4968133 glBindTexture() not needed?

Posted by darookie on 10 August 2012 - 10:38 AM

You'll notice there also are no calls to glGenTextures. Texture objects, which require the calls to gen/bind/texture were added to OpenGL in version 1.1.

glGenTextures is actually not required. The function simply asks the implementation for available texture object names, not texture objects. If you manage your own texture object ids, glGenTextures is actually not necessary. Likewise glBindTexture will simply bind a name to a texture object - in effect it only provides an alias - not using the function will simply replace/use the default texture object for the selected target.


#4968128 glBindTexture() not needed?

Posted by darookie on 10 August 2012 - 10:30 AM

The samples work because they use only one single texture. OpenGL is a state machine and has some default values defined, like default texture object name. You will need to call glBindtexture as soon as you need more than one texture. Since the default case is to have more than one texture per scene, glBindTexture is the recommended way to go.
In short: no, the website is not lying, it's just not telling the whole story at this point.




PARTNERS