View Full Version : Labyrinth with mouse
ErosOlmi
17-02-2007, 23:30
Another Labyrinth version now using mouse.
Please help me improving mouse sensibility and better movements.
Ciao
Eros
Petr Schreiber
18-02-2007, 00:02
Hey Eros,
this rocks!
It is perfect implementation of Atlantis games mouse look !
Great!,
Petr
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!!
Petr Schreiber
18-02-2007, 12:22
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
Petr Schreiber
18-02-2007, 15:14
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 ;)
Michael Hartlef
18-02-2007, 15:17
Cool! I like it. Like you said, a nice start. :)
ErosOlmi
18-02-2007, 15:59
OK, video of first starting FPS framework by Petr.
Rp0VMRIBoYU
http://www.youtube.com/watch?v=Rp0VMRIBoYU
My impression: fantastic starting. How could it be different when Petr is on it?
Now bad news :D
I would like ... ::)
better mouse movements. Current one seems delayed a bit
something to shot to :D
some basic 3D objects like cubes or whatever could be enough
maybe some functionalities can be moved to full compiled functions like:
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
In this way they will be much faster
ErosOlmi
18-02-2007, 16:15
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":
'---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
Petr Schreiber
18-02-2007, 21:39
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 :D 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.
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!!
Petr Schreiber
19-02-2007, 10:01
Hi,
interesting ideas. But imagine the mouse is on the left edge of screen and you want to make quick move towards left - no chance to read the speed here. Maybe there is some Win32 stuff to get delta of mouse not depending on its position, I will investigate a bit.
Regarding flashlight - I was thinking of hybrid blended approach, when you get full light bitmap, and then read per pixel values from depth buffer to decrease brightness of texels with increasing distance. But I am not sure how to do it fast for the moment :)
Thanks,
Petr
P.S. New card for HL2 ? I have old Radeon 9600 and I think I get most of the effects, maybe except full HDR.
It is funny I play these games all the time and you never really pay attention to the input as it seems so natural. I went into UT2K4 just now to test out the first person input. You are right, the mouse never seems to hang at the border (or what you would think is the border), and also, it does seem to go forever with sensing velocity of mouse moves by rotating very responsively to the users mouse moves.
Hmmmm, it makes it even a harder mystery now. Please let me know of any info you find, I will do the same. The great mouse and overall input to a game the more professional and fun to play it is!!
Petr Schreiber
20-02-2007, 00:34
Yes,
it is very mysterious :)
Are you able to run any commercial game in windowed mode to see what happens to poor mouse cursor ?
Petr
I was rushing this morning. I think unreal runs in windows mode, will test and report later. If we can figure this out, we will be dangerous. While I was out today, I also remembered the quake download of source, maybe can scour through there and see how they handled mouse input. It will be fun researching. So much fun stuff to work on, not enough hours in the day.