Pages: « 1 2 3 »
  Print  
Author Topic: Commit Privileges  (Read 11297 times)
Offline (Unknown gender) forthevin
Reply #15 Posted on: November 13, 2012, 09:13:42 PM

Contributor
Joined: Jun 2012
Posts: 171

View Profile
Hi polygone, I have committed a change that should fix the lighting for positional lights. Note that not all lights may be active, since in some cases, OpenGL only offers 8 lights. This seems consistent with GameMaker:Studio, since its manual says that at most 8 lights should be active at once. I have also fixed the normal for the walls, and the normal for the floor is correct if the floor is not slanted.
Logged
Offline (Male) polygone
Reply #16 Posted on: November 14, 2012, 09:01:31 AM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
The normals haven't been added to the basic shapes at all, but that is a different story. If you run this 3d example in ENIGMA and GM you will see the difference:
http://enigma-dev.org/edc/games.php?game=31

Here's a screenshot comparing (ENIGMA on the left, GM on the right):
http://i.imgur.com/HkpzC.png

You will see it with other examples as well on the EDC, it's like the normals aren't being used at all; even though the normals are being set manually in the d3d_model_vertex_normal functions used in the model drawing. I know the normal values in the games are right because they are working fine with GM and the model function calls are fine since everything is in the right position in ENIGMA.
« Last Edit: November 14, 2012, 09:08:06 AM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Unknown gender) forthevin
Reply #17 Posted on: November 14, 2012, 01:59:34 PM

Contributor
Joined: Jun 2012
Posts: 171

View Profile
I got the Kingspace engine demo running correctly with lights, the latest commit should fix it. I fixed the directional lights and the light position update (it was being updated in the wrong place). The screenshot you uploaded fits with what I get after the latest fixes.

I had some trouble getting the Kingspace engine demo up and running on Linux. I found out that the path was formatted wrongly in file_bin_open in fileio.cpp - amongst other things, the path returned from get_working_directory() didn't include a starting slash.
Logged
Offline (Male) Josh @ Dreamland
Reply #18 Posted on: November 14, 2012, 03:43:56 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2955

View Profile Email
Please stop fucking using get_working_directory(). All of you.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) polygone
Reply #19 Posted on: November 14, 2012, 03:52:36 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
You can macro it and add an option for it if you want it to be sorted.
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) polygone
Reply #20 Posted on: November 14, 2012, 03:58:00 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
And nice one forthevin for sorting out the lighting! Been an annoying problem. I see it's handy having somebody who's actually used opengl lighting before as opposed to me trying to get it to work when I've never worked with opengl before.

I would love to test it right now but it appears that something is going horribly wrong, most like due to one of the recent commits by josh.
- to the irc I fly
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) polygone
Reply #21 Posted on: November 14, 2012, 04:26:45 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
That segfault has been sorted, and it looks like the lighting works yay! I shall now come to you with all my problems :)
Ok I'll give you a break so you can get on with your particles. I do have another problem with a collision engine but I'll try and debug that a little myself first as I doubt it's specific to what you committed.
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) Josh @ Dreamland
Reply #22 Posted on: November 14, 2012, 09:50:09 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2955

View Profile Email
I don't want it to have an option; it should never appear in your code. Ever. The operating system handles it. Or at least it should, in a correct implementation, which I WILL have it use in the near future.

Anyway, I saw your request to remove the tracker link from the title bar, and I decided to make titles shiny instead.
Also, went ahead and fixed the avatar gallery, since that's been broken for God knows how long.
« Last Edit: November 15, 2012, 12:43:06 AM by Josh @ Dreamland » Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) TheExDeus
Reply #23 Posted on: November 15, 2012, 01:54:22 AM

Developer
Joined: Apr 2008
Posts: 1886

View Profile
Yes, all references for get_working_directory() should be removed and instead the ENIGMA should be fixed in that respect. So just changing directory before running the game.
Logged
Offline (Male) Josh @ Dreamland
Reply #24 Posted on: November 16, 2012, 10:45:03 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2955

View Profile Email
Okay, gentlemen; I just noticed you were talking about move_bounce. I am not privy to how you implemented it or move_contact, but I am hoping that for bbox, you just do some subtraction, and then for precise, you do some subtraction and then do a binary search (add one, add two instead, add four instead, add eight instead, add sixteen instead, add twelve instead, add eleven instead). Otherwise, I have more cleaning up to do when I'm finally free.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) forthevin
Reply #25 Posted on: November 18, 2012, 03:04:50 PM

Contributor
Joined: Jun 2012
Posts: 171

View Profile
Subtraction is used in move_contact and move_bounce in bbox, and I have just added subtraction to move_contact in precise.

The current implementation of move_bounce in precise is similar in behaviour and speed to move_bounce in GameMaker. It only uses a constant number of collision checks, which is fast, but not very accurate. Subtraction would only be useful if move_bounce is made more accurate, but I think that making it more accurate would make it slower than the implementation in GameMaker.

I have thought about using binary search for move_contact as well, but I think it can only be used correctly if the collision mask is "stretched"/repeated along a line for each check. Else, the binary search might skip collisions. Since "stretching" a bit mask along a line is quite slow for medium and large bit masks, it would probably be slow in most cases to use binary search in move_contact in precise. Since a line can be "stretched" quickly, I think binary search could be used for something like collision_line_contact. Certain polygons may also be fast to "stretch".
Logged
Offline (Male) polygone
Reply #26 Posted on: November 18, 2012, 03:34:08 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
Note that with precise that the instance could collide with the bbox of an object but then not actually collide with the object in precise when moving forward. You could keep checking to see if the instance moves past the object without colliding then do a further bbox check beyond that; however it's probably not common enough a scenario for that to be efficient.

Looking at your code I'm also confused what this part is doing in there:

Code: [Select]
    double current_dist = DMIN;
    {
        double next_x = x + mid_dist*cos_angle;
        double next_y = y - mid_dist*sin_angle;
        if (collide_inst_inst(object, solid_only, true, next_x, next_y) == NULL) {
            inst1->x = next_x;
            inst1->y = next_y;
            current_dist = mid_dist;
        }
    }
I don't think it should be there at all.
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) polygone
Reply #27 Posted on: November 18, 2012, 04:53:17 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
As a testament to the precise collision system working I have posted a sonic engine at the EDC:
http://enigma-dev.org/edc/games.php?game=37

The slopes and loop seem to be functioning completely correctly.
Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Male) polygone
Reply #28 Posted on: November 18, 2012, 05:32:25 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
Forthevin can I just ask when you tried the house effects demo did you see some bugged random flicking in the candle glow when you moved around the scene? Like this:
http://s8.postimage.org/f5f9r238l/Open_GL_Alpha_Primitive_Issue.png

It's rather annoying. It's being causes because the glow is transparent and being drawn with random scaling each step:
Code: [Select]
d3d_transform_add_scaling(1,.8+random(.1),.9+random(.1));
But yeah this crap isn't happening in GM, I wonder if it can even be fixed or not.

There's another small niggle as well, you can see in the image at the candle base there is a kind of white outlining to the bottom of the cone which isn't very pretty. You can see it at the bottom of the curtains as well but not at the bottom of the big cylinder pillars for some reason. I don't know what's causing this, it's not the interpolation this time as it happens when that's turned off as well.
EDIT: I see if I get rid of the reflect it goes and I can see it more clearly just drawing the reflect that the white is being drawn at the bottom of the reflected candle cone for some reason.
EDIT2: OK I see it's just the z-fighting with the floor meh. OpenGL seems to have much worse z-fighting niggles than DirectX does.
« Last Edit: November 18, 2012, 06:41:18 PM by polygone » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Offline (Female) IsmAvatar
Reply #29 Posted on: November 19, 2012, 01:31:01 AM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 886

View Profile Email
That looks like Z-fighting. (Edit: Yup, you already figured it out)

As for the binary search, I must be misunderstanding where you plan on applying it, as it wouldn't work for a search loop, simply because of small objects being overlooked that way. A binary search is only useful on sorted data. In a collision search loop, there is no sorting. The data is 1's and 0's (collision or free), in no order.

forthevin: By the way, you can clump a bunch of similar changes together in 1 commit, or even make a group of commits and then squash them before pushing. That way the git doesn't seem flooded with small commits. Just a thought. You can do it however you want, since we're a small team.
« Last Edit: November 19, 2012, 01:33:33 AM by IsmAvatar » Logged
Pages: « 1 2 3 »
  Print