Jump to content
  • entries
    5
  • comments
    43
  • views
    10,569

No sign of any uploads recently... Still working on it?


Mumbles

3,364 views

 Share

That might be a question going through some people's minds. The answer is "yes" I'm still working on it. Just much slower than before.

 

At the start of the project everything was working brilliantly, I'd got as far as adding an external newton into the project. I'd even got it to correctly build the physics shapes from wavefront obj files on-the-fly, and force and torque was all working too. So where did progress suddenly freeze?

 

The answer was the player controller. I would have to write my own so that it could be processed by a dedicated without the leadwerks graphics. Problems keep coming in when I find that I've built something that ends up needing entities. Because of course, if you have not called Graphics() and CreateWorld() you can't create entities... So far I've been able to work around, but anyone who's active on the boards will have noticed my most recent problem, posted as a status message last night.

 

...The problem now is that Newton always adds forces in global space. So when I want to move my player forward, I have to transform a Vec3 of (0.0f,0.0f,1.0f) into whatever the correct vector would be for the angle the entity is facing. There is the problem, TFormVector's second and third parameters are entities, so graphics needed. Josh came to the rescue with some source code in an email. I believe it's meant to be private, so I won't post it here. The problem is it's BlitzMax code, so it doesn't translate exactly.

 

  • The code has a TMat4 data type, but my version of the engine does not. From reading the wiki, I have changed these to TVec16 but then there's another problem
  • It does something like this:
    TVec16 TempMatrix;
    TempMatrix.inverse();


  • TVec16 in the C interface does not have an inverse function, and I can't seem to find command in the wiki that would do this. In fact, if you press the "dot" key after a declared matrix, visual studio will show you 16 fields: A0, A1, A2, A3, B0, B1, B2, B3, C0, C1, C2, C3, D0, D1, D2, D3 ... A TVec16 does not seem to have any other members that I can find.

 

The other problem is that I can't build an inverse function myself because I have no idea what it is supposed to do. One thing about me is that I did not do A-level maths. My uni course covered matrices very briefly. We were taught, as an example "Here are two matrices -> this is how you multiply them together" . That much, I can do, but we were never shown what they might actually be used for. I have no idea what the inverse of a matrix is... Reverse the order? Flip the rows and the columns with each other? I just don't know.

 

I would ask Josh, but he has already provided enough help, even when he didn't have to. I'm sure he's busy enough with the next version of the engine, that he doesn't really have time to spoon feed what is probably basic level stuff, and so it would be just plain wrong (and selfish) to ask ('nag' may be a more appropriate word).

 

It's depressing stuff, which has brought the development speed of my project almost to a complete stop. But I've not totally given up on the project... Not yet.

 Share

9 Comments


Recommended Comments

Do you mind if I call you Mumbly-chan? Okay Mumbly-chan, here's my suggestion: Lower the scope of your project. Let's just get something done, no matter how humble.

 

I won't actually be able to incorporate RPG gameplay until Leadwerks 3 so for now the scope of my project is less than it was before. Now my goal is just to have a character run around and interact with the environment and to basically collision test whack a monster into oblivion. No inventory, no save system, no cut scenes. All extremely simple stuff.

 

Because that's what I'm capable of right now even when I try my best! ;)

Link to comment

The 16 members of a 4x4 matrix are usually numbered in mathematics like Y and X coordinate (the university teachers speak of columns and rows, which is kinda stupid, since even I think in Excel with x and y coordinates (much easier to make VB scripts that way)).

 

So when they say m11,m12,m13,m14 (or m00,m01,m02,m03, if they start with 0 instead of 1, which is unusual since when talking about columns and rows you start with 1, so basically mathematicians have no clue about consistency, only C++ programmers do), they actually mean: cell at coordinate 1,1; 2,1; 3,1; 4,1. So in LE you have TVec16 which calls them A0,A1,A2,A3. For y==2, it's called B0,B1,B2,B3, etc...

 

I could have called them like in mathematics, but then I would have needed to use y,x=x,y coordinate system, which would cause even more confusion between programmers and mathematicians. So calling them with letter+index can not be interpreted wrong, and it's also shorter to type. And yes, it is a common standard notation also, I checked several sites about it. It also unifies vector and matrix notation which is kinda cool.

 

And since it's a Vec16, and not a Mat4 (which are the same thing though), you don't use x and y coordinates in Vecs. If I would have used Mat4, it would have been inconsistent again since it would be totally different that the Vec2,3,4,6 structs, which I wanted to avoid, since it's basically the same thing: just a container for an n-amount of floats.

 

However, in addition to TVec16, there could be also TMat4 in the C headers, which would be the same as TVec16, but only using different member names. How useful that would be, I don't know.

Link to comment

I didn't have any issues with the A0 through D3 element numbering, I figured that bit out. My point was that a Vec16 didn't have an invert operation. At the time, I thought this was some proprietary code of Josh's that just didn't exist anywhere else.

 

 

...But it looks like DaDonik has solved that bit for me. The code on the highlighted site doesn't look very complicated... just long. I can live with long, so long as I know what it's trying to do.

 

What I don't know about that code is why it works... But that's not important in maths. Maths isn't about explanations, it's about blindly following rules. Things only go wrong when you don't follow the rules correctly, or follow the wrong rules.

 

In any case, when I get a bit of motivation back, I will try it out and hopefully carry on with the project.

Link to comment

Two things from a german -

 

one does not need to know everything but one need to know where to find the right answer.

 

Dont downgrade your reality or youll end up somewhere completely different as initially planned.

 

PS: Vector and matrix math seams to be the only game programming related math i continuously find in the interwebs. ;)

Link to comment

After a bit of reading, I can now invert a 3x3 matrix. Apparently inverting a 4x4 is jst a matter of breaking it down into four 3x3s? Or something like that...

 

Maths just seems to be one of those things that if you don't learn in school/college, it becomes so much harder to learn it yourself later. If i'd learned it at college, it would probably be really easy for me to do...

Link to comment

Don't worry, I've learned everything in university, but never understood linear algebra which talked about m*n matrices and their operations.

That's why you buy a entity oriented game engine like LE, so you don't have to use maths ever in your life again.

All you need is PositionEntity, TurnEntity, PointEntity, and other of those simple, logical and natural commands.

Link to comment

Its too early in the morning to understand what you guys talking about but it does look interessting. I'll have another look in the afternoon. :D

 

I do agree with pancakes on the complexity. Although you are smart enough to find it out eventually, you can save yourself a lot of time by doing things a little more simplified.

 

Good luck with your progress!

Link to comment

All you need is PositionEntity, TurnEntity, PointEntity, and other of those simple, logical and natural commands.

 

That works... until the commands require a graphics context.

 

I'm not ready to do dedicated servers yet. But when I am, I don't want to have make loads of changes. I think it's better to try and get it right first time.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...