Jump to content

  • Log In with Google      Sign In   
  • Create Account

JohnnyCode

Member Since 10 Mar 2008
Offline Last Active Today, 03:55 AM

#5289648 Should i learn Win32 or UWP?(C++, Directx)

Posted by JohnnyCode on 01 May 2016 - 06:27 PM

Win32 is the actual base of entire OS, it is the native run time, that even managed runtime (entire C#) works over. C# and c++ native runtimes are interchangable for programer as well, with CppCLI modules. 

 

Though CLI should be used sparsely. It is c++ that will always get your way, though in much higher difficultly. That is why more light weight and practical layers get introduced, what is UWP as well.




#5289241 Which alignment to use?

Posted by JohnnyCode on 29 April 2016 - 08:54 AM

 

So "Component" is a user-defined class, derived of a BaseComponent-class. This BaseComponent has a member "m_parent" that stores a handle to the owner of the component, which needs to be preserved (ie. in the move-assignment-operator). Now some of the derived classes might have custom copy/move-operators/ctors. The problem turned out that if you override the move-operator in the derived class, the operator of the base-class is not called anymore, and so I ended up with having incorrect parent-handles in my components, specially after deleting one component from the middle.

 

After I understand your measures in more scale, which is quite a "big bounty" like, I  would stop speaking about pointers, pointers are guarenteed to point to a memory that does not change its position, a heap allocated T *p=new T().

That is not a case in your pooled objects in vector, but you definitely could achieve all those measures by using indexes of vector contained objects instead.

 

One viable way I see, is to use vector as "instead of heap manager" and use it with conjunction of a linked list of the very indexes , to achieve this hierarchy/arbitrary pointing structure you want to have.

 

You could even delay the erase operations of the vector, to not process memory movement of it at every trivial freeing, while still able to keep adding new objects, and call erase in some more-wise condition, like GC.

 

Something like this:

 

-LinkedList of structures that contain :[real index to vector, real index to the owner- in vector]

-erasing from LinkedList will trivialy remove the node, keeping all vector real indexes in objects in LinkedList still intact, since real removal is not called, +update the owned object owner index to magic value of none. Add the free index to an integer array Fr. (thus the linked list becomes the immediate structure of your program to access the objects, or manipulate them)

- If in FR array is a bigger continous amount of values (indexes), call erase with this one enough large interval (vector::erase has overload for interval removal)

- Before you do this real erase on vector- you are already being viable to update the linked list real indexes- you see my point, so you call linked list update on idexes first, then vector erase-with the interval.

-now you can have external references around your program, wheather in private or public-managed sections, even if real objects gets moved in vector management

 

Of course, the fact of linked list, though of very small structures, is a certain performance hit, but it provides this measure to safely use and access your objects even if they get moved by managing vector.




#5285984 Assembling A Large Dev Team

Posted by JohnnyCode on 09 April 2016 - 04:28 AM

Well yes, very first and best step would be to acquire a person that has been involved in an entire production proccess of a game and maintaining it (QA director, producer, lead programer maybe, etc. positions). This person will answer all pile of knowledge misses you might have as investment donator and game designer (I'm not saying ultimately tho).




#5283836 Learning Animation/Illustration for Video Game Art Questions

Posted by JohnnyCode on 28 March 2016 - 07:05 AM


Dude, no school will make you learn art, the thing school might do to you is make you procrastinate less and practice more, which is what you need to get good at art

But it will teach him to produce art. Producing art and capturing art is nothing trivial.

 

You can be "greatly competent" for making art even without talent, if you happen to gain knowledge about art, wheather it'd be producing, resulting and effect/critic.

 

For an artist/designer, it is very benefitial to obtain a school. If it would happen to be some great uni, you cannot be turned away possibly from no one who wish to hire an artist or someone to work at artisitic results.

 

Without a school, you will never get proffesional in art production, you simply cannot- there will be too many competitors with school on every damn position.




#5283143 How can I locate a memory leak?

Posted by JohnnyCode on 24 March 2016 - 08:23 AM


I'm inclined to agree with Khatharr. RAII is in my experience the way to go (and again to reinforce, if you think RAII means std::shared_ptr/std::unique_ptr then you have completely missed the point of RAII). Sometimes getting a good RAII concept (including some potentially backing infrastructure) for a problem going takes a bit of time and work. But in my experience the time, work and most especially nerves you save by that are well worth the price.

Yes, it is actualy a great(correct) technique of coding, but in my understanding, it will not protect you from exceptional accesses, uncomforming data passes between modules, etc. and in my experience, those unlucky events are the most common source of leaks.




#5283130 slerp of two pairs of vectors

Posted by JohnnyCode on 24 March 2016 - 07:54 AM

If there are two unit orthogonal vectors A and B, and they slerp to two orthogonal unit vectors C and D, indivdualy but by the same factor value, do they preserve the orthogonality on entire way?

 

I cannot imagine it well enough to provide me a decision, weather positive or negative, so I try to state a proof to , but I am not sure, here it would be:

 

A . B=1 and C . D=1 , is A1 . B1 =1 for all t<0.0,1.0> if

A1=sin((1-t)*h)/sin(h)*A+sin(t*h)/sin(h)*C;

B1=sin((1-t)*j)/sin(j)*B+sin(t*j)/sin(j)*D;

h=acos(A . C)

j=acos (B . D)

 

Please, help me crack this proof/statement.




#5280025 How to find the cause of framedrops

Posted by JohnnyCode on 07 March 2016 - 11:07 AM

Have you compiled release version, without dx debug runtime libraries linked, debugging disabled, and possibly code optimization enabled?

Without code optimization, you can sometimes face ridiculous cache breaks etc.

Do that, and you can also start windows in safe mode, start your release version, with possibly dx redistributable drivers deployed up again.




#5276151 Point Light and Normals

Posted by JohnnyCode on 17 February 2016 - 11:53 AM


@vinterberg: If the I set the normals to face the inside of the box and I can one light inside the box and another one outside of the box, The light inside will work while the light outside will not work correctly.

Why do you not index/create inside triangles as well as outside triangles? You do not need extra verticies for that.




#5275533 Triangle rendered white only.

Posted by JohnnyCode on 13 February 2016 - 04:59 AM

The vertex color if all white does not interpolate visibly, so I would say you have a problem in vertex color values, or, vertex color attribute setting.

 


glVertexAttribPointer(1,4,GL_FLOAT,GL_FALSE,sizeof(VertexFormat),(void*)(offsetof(VertexFormat,VertexFormat::color)));

 

Are you sure your vertex colors are 4 component float vectors (see VertexFormat structure)? They generaly are 4 component vectors of bytes. If so change GL_FLOAT to unsigned byte.




#5273993 Weather simulation

Posted by JohnnyCode on 02 February 2016 - 08:59 PM


There is a large portion of the state space that forms the basin of a chaotic attractor that is what corresponds to actual observed weather. If you start too far away from typical conditions, you may be in the basin of a different attractor (e.g., snowball Earth). But it shouldn't be too hard to get the initial conditions in the right ballpark.

So then the weather is is an entropy system of chaos well defined over the rest of condition?(heat, energy, matter, chemical reorganization) And when the outside entropy is well defined, the weather will unfold in its exact form as consequnce? but to bottom-catch weather like this, is, like to simulate universe from big bang after a (few) pictures of the bang. Quite hard to manage, or not?




#5273983 Weather simulation

Posted by JohnnyCode on 02 February 2016 - 07:52 PM


I don't know if it's the grammar or just the punctuation, but I don't understand what you wrote.

I wanted to stress that I think that initial conditions of a weather system are as vital as its corect behaviorals. If second is perfect, the system will not be simulated without first. Weather is a cycling system, just as orbits, without parameters of it, they cannot behave as you would expect, even if you would establish newton force of attraction, and base system on some reduced observation set up (position).




#5273977 Weather simulation

Posted by JohnnyCode on 02 February 2016 - 07:42 PM


I don't think the initial conditions are a big deal: If you know how to run your simulation forward, you should achieve plausible states quickly, even if you started with quite implausible ones (there is probably some formal statement of this using the notion of "thermal equilibrium", but I am not even going to try to go there).

There is a lot of balance in weather on earth without time trace up, as encapsulated weather subject, without those as established, I guess really the simulation would become some sort of a furnace, like moon and earth spawned in space would just go collapse towards each other. Like, that New York is more south than Madrid, yet the weather and temperatures and ecosystem are incomparable becouse of some water stream.




#5269583 Need hardware recommendation

Posted by JohnnyCode on 06 January 2016 - 03:30 AM


Are you really going to be building the next Crysis or what have you in the next few years? Unity, Maya, and Photoshop all run great on a mid-range consumer laptop. Hell, I was running all of the above 5 years ago on an 11" MacBook Air...

Apple macbook pro are exeptional beasts, I have no idea how they do it, it is quite paranormal to me.  If one plans on working with rasters and 3d graphics production/animation, he should aim for a desktop to accomodate next to him. The low consumption of TDP in notebook processors is really spoiling any kind of exhoustive work, in a disturbing extent.




#5268798 Matrix Major and multiplication

Posted by JohnnyCode on 02 January 2016 - 01:39 AM


In that case, mathematically is subscript Mij always interpreted as the i-th column and j-th row of Matrix M?

Regardless of the major of the matrix?

 

It is very common to see [row][column] instead of [column][row] indexing, but that does not have much to do with majorness, as the termines row and column are not defined in linear algebra, the majorness equivalently relates to how matricies transform vectors, but commonly column is the base/space vector.

 

Since matrix is an ordered set of vectors, you should specify the vectors in it, this way you have no doubt how to transform vectors with it, thus what matrix it actually is.




#5268684 Matrix Major and multiplication

Posted by JohnnyCode on 01 January 2016 - 02:27 AM


The way i interpret the above formula is:

Element (i, j) of Matrix AB is equal to the dot product of Row I from Matrix A and Column J from Matrix B

No, the formula stays in-tact without you having interpreted i and j respectively, as columns/rows, or, rows/columns.

The formula is explicit only about relation of arbitrary 2d and 2d, it can take any dimensions as prior literaly.






PARTNERS