doom research

About Monkey 2 Forums Monkey 2 Projects doom research

This topic contains 29 replies, has 4 voices, and was last updated by  AdamStrange 1 year, 9 months ago.

Viewing 15 posts - 1 through 15 (of 30 total)
  • Author
    Posts
  • #8912

    AdamStrange
    Participant

    After some tentative steps back into 3d. I thought I’de take a look into maps and collision.

    This leads back to Doom and a method I tinkered with many years ago:

    Consider it this way:

    You have a map that is constructed ONLY of triangles. Each triangle is made from 3 lines and each line is made from 2 vertexes, there is no duplication in any data.

    A Line can be thought of as

    NONE (grey) – it does nothing and just joins areas together

    TRIGGER (red) –  similar to NONE, but it signals if the player has gone over it

    WALL (yellow) – the player has gone over the line and is bounced back (collided with).

    The images are presented:

    top – the actual top down view with vertexes and lines numbered

    top rotated – the vertexes rotated and lines drawn so that everything is facing the player correctly – used for depth testing

    front – a faux 3d view giving a basic look in 3d. Yes – the corner of one vertex has been raised at the floor creating an upward slope!

     

    Assuming no actual 3d geometry (at this stage), this would be the first step in creating a proper 1st person engine.

    On adding geometry, You would have a 3d geometry map of different 3d objects, and this collision map.

    You would have no calculations done on complex 3d models at all. just the simple map shown above.

    thoughts?

    #8915

    EdzUp
    Participant

    Ah loved these engine back in the day and would love to see one made in MX2 🙂

    #8934

    AdamStrange
    Participant

    small steps this stage. but looking positive

    #8939

    AdamStrange
    Participant

    Moved direct into 3d. so I’ve now got a proper openGL 3d view, with the 2d map being added so I can see whats going on.

    The red diamond, is just a marker denoting 1 in the X axis, with the grid being at .5 spaces

    #8940

    EdzUp
    Participant

    ah that’s cheating it has to be 100% 2d no 3d opengl stuff lol 😉

    #8951

    AdamStrange
    Participant

    Using 3d as the display was always my intention. but I take your point…

    I am using the original doom concepts though.

    Using a few custom models I can now view a basic framework:

    You can see it’s the same map with the lines, etc. I’m working on sliding collision as it currently stutters, so I am looking into using some vectors and other weird stuff.

    But the essence of it is operational 😉

    #8953

    AdamStrange
    Participant

    ooh, solved the stuttering with sliding collision and some interesting math.

    for any line, it has a normalised vector (all calculated automatically when you add a line) and also an angle (of direction)

    when you collide with a line, you can compare your angle of direction with the lines angle of direction. if you add 90 (degrees) you should be parallel to the line

    using this you get a – if you are facing towards the core vertex of the line or a + if you are facing away. you use this to modify the position – simples….

    and heres the code:

    with the debug code as well

    px, py is the position you are checking

    ops,opy is the old position

    #8955

    AdamStrange
    Participant

    replacing the blank walls with some test geometry

    although there are height errors, you can see that we don’t need to test for the geometry, just the underlying map

    as proof of working, it is not too bad. I need to add heights to things now

    #8956

    AdamStrange
    Participant

    taking the above a single step further by adding some more ‘stuff’ to the wall and correcting the heights:

    and maybe boost the light a bit:

    there are no textures and just a single light. you can see it’s all the same map as was being used before…

    #8957

    AdamStrange
    Participant

    And the final one for the day adding some cross braces along the lines. Again the map has not changed, just added a single model to the drawing:

    #8958

    EdzUp
    Participant

    very nice 🙂

    #8964

    cocon
    Participant

    A year ago I played “Brutal Doom” and I was hooked for weeks. I have put also attempts to study the source code, however mostly at this time I am interested in the system design generally, not touched the graphics at all.

    #8981

    AdamStrange
    Participant

    I’de be very interested in any suggestions to do with AI?

    #8994

    Sledge
    Participant

    From observation rather than reading the source, there seems to be an awful lot of navigating by zig-zagging, with the added gameplay bonus that the player is often tracking horizontally by necessity.

    #9037

    AdamStrange
    Participant

    interesting to note the diagonal behaviour.

    Still working on the base map generation.

    Here you can see I’ve removed the wall objects, but you can see that each triangle now has a floor level. this is shown in the main pic by the triangles dropping in height -Stairs!

    Also looking at the two top maps you can see all exterior walls are now yellow. and triangles that are connected, BUT have different heights are shown as a lighter grey.

    Previously this was done when you defined the linekind, but I’ve now removed this and it is all automatically calculated!

    Unlike doom where there is a long wait when a map is created and it goes into the BSP (Binary space partitioning), this is all realtime and be calculated whenever it needs to be.

    I think next will be to streamline the vertex rotations, and use them as a “behind me, remove me” system to speed up drawing…

Viewing 15 posts - 1 through 15 (of 30 total)

You must be logged in to reply to this topic.