Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Labyrinth with mouse

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Labyrinth with mouse

    Another Labyrinth version now using mouse.
    Please help me improving mouse sensibility and better movements.

    Ciao
    Eros
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Labyrinth with mouse

    Hey Eros,

    this rocks!
    It is perfect implementation of Atlantis games mouse look !

    Great!,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Labyrinth with mouse

    Eros, mouse and keyboard input are so important and I have been waiting for the days we are in with thinBasic and tbgl. So very nice to see a demo out with the starts of a full user interface with input for keyboard and mouse!!!

    It would be neat if you and Petr could work on an input module. Where standard input could be called with a few commands.

    For example:

    StandardFPS:
    W or Up Arrow moves forward
    S or Down Arrow moves backward
    A or Left Arrow strafes left
    D or Right Arrow strages right

    You look with the mouse, and it determines your direction while moving.

    C or CTRL crouch

    SpaceBar jump

    E is use key
    F for flashlight
    G is secondary use or kick

    Mouse wheel scrolls weapons, left mouse fires, right mouse alt fire.

    I think counter-strike has a crawl where you were always crouched or laying down, loved that, but can't remember the key they used.
    Return to Castle Wolfenstein has kick, and peak around corners, really neat.

    But you get the idea. If with one command or two a user could get basic input, wow that would be awesome.

    THanks again for the demo!!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Labyrinth with mouse

    Hi kent,

    more devices are planned to be supported in TBGL.

    Your suggestion regarding keys is nice,
    but maybe better introduced using some framework code.

    I will post it today, heavily based on Eros mouse look


    Bye,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Labyrinth with mouse

    Hi,

    this is first version of something which could be called FPS framework in future
    It supports W,S,A,D + arrows for movement, holding SHIFT for running, CTRL to crouch, some flying and flashlight by default.


    Bye,
    Petr

    P.S. On this model it is very evident per vertex lighting is not great stuff for spotlights. Easier and nicer would be blended quad with "light circle", but this way it behaves too bad for someone.

    P.P.S. I am now under the "curse of Half Life 2" - I bought it with brother yesterday and I can't stop playing it ;D Terrific game with beautiful spotlight effect
    Attached Files Attached Files
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #6

    Re: Labyrinth with mouse

    Cool! I like it. Like you said, a nice start.

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Labyrinth with mouse

    OK, video of first starting FPS framework by Petr.

    [youtube=425,350]Rp0VMRIBoYU[/youtube]


    My impression: fantastic starting. How could it be different when Petr is on it?

    Now bad news
    I would like ... :
    • better mouse movements. Current one seems delayed a bit
    • something to shot to
      some basic 3D objects like cubes or whatever could be enough
    • maybe some functionalities can be moved to full compiled functions like:
    [code=thinbasic] sub GetMouseDeltaBYREF( byref mX as single, byref mY as single )
    local x, y as single

    dialog get client hWnd to x,y
    mX = (tbgl_MouseGetPosX-x/2) / (x/2)
    mY = (tbgl_MouseGetPosY-y/2) / (y/2)
    end sub
    [/code]
    • In this way they will be much faster

    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Labyrinth with mouse

    Petr,

    just in case you need some info on how to create a keyword in TBGL that needs variables passed by reference (like I suggested in previous post), here it is an little Power Basic example on which functions to use from thinCore.dll interface to be able to change one or more variables passed byref like "dialog get client hWnd to x, y":
    [code=thinbasic]
    '---Declare needed variables. To change a variable we need
    '---a reference pointer and an aboslute position (in case of arrays)
    LOCAL lVariablePtr1 AS LONG
    LOCAL lVariableAbsPos1 AS LONG
    LOCAL eResult1 AS EXT

    LOCAL lVariablePtr2 AS LONG
    LOCAL lVariableAbsPos2 AS LONG
    LOCAL eResult2 AS EXT

    '---Check if any error
    IF thinBasic_ErrorFree THEN
    '---Get reference of first variable
    thinBasic_VariableParse(lVariablePtr1, lVariableAbsPos1)

    '---Check if comma
    IF thinBasic_CheckComma() AND thinBasic_ErrorFree THEN

    '---Get reference of second variable
    thinBasic_VariableParse(lVariablePtr2, lVariableAbsPos2)

    IF thinBasic_ErrorFree THEN

    '---Here do what you need to do


    '---Now assign values to referenced variables
    thinBasic_ChangeVariableNumberDirect (lVariablePtr1, lVariableAbsPos1, eResult1)
    thinBasic_ChangeVariableNumberDirect (lVariablePtr2, lVariableAbsPos2, eResult2)

    END IF
    END IF
    END IF
    [/code]
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Labyrinth with mouse

    Hi Eros,

    thanks a lot for SDK sample and suggestions!

    Of course this sample could ( and should ) be upgraded.
    I am afraid the vertex spotlight won't survive and will be replaced with blended or other solution.

    I will think about what can be done, built in byref module stuff looks good way to me.

    Regarding enemies, I know you miss them I have managed ok the periodical animations for zombies, so hope to complete some linear and implement them as poor victims. I know I am promising this feature for ages...

    Mouse look - I am generally used to implement it as following:
    DO
    * set cursor to center of screen
    * let user move mouse, measure deviation from center and make appropiate camera move
    LOOP

    This is very problematic in windowed mode, because it would block user from controlling mouse for handling other applications, windows...


    Thanks again,
    Petr

    P.S. Nice video. As you can see the tunnel is hardbaked using thinEdge linear fade tool, so even the spotlight can't reveal what is in dakness. This can be good for kind of very special situations, with monsters in total obscurity.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #10
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Labyrinth with mouse

    Petr, first thanks. Very very cool!! Having that sort of lighting really adds to the drama. Halo and the flashlight is what it felt like

    The reason I suggested a keyword type setup was for speed. I thought it if was all compiled ahead of time it would be faster.

    One recommendation is. Not to use the screen center and offset to measure. Just the old mouse xy and new mousexy distance, add this to the translate. When it is at the edge of the screen, keep rotating in that direction. Even the new mousexy is not incrementing as you can move the mouse at the edge of the window or screen, you can just then add 1 as if it was moving to make it work. It behaves then more like a normal mouse interaction in FPS game.

    I am amazed by the lighting and what all you are pulling off with the tbgl module. Glad you are enjoying half-life2. I stopped playing and waiting till I purchase a new video card to play it. I did the first few levels though, it is an immersive game like halo for sure. Have fun!!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Page 1 of 2 12 LastLast

Similar Threads

  1. Labyrinth Preview
    By Petr Schreiber in forum TBGL Labyrinth
    Replies: 60
    Last Post: 07-05-2006, 20:05

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •