logolinksrand Hamburg City Freelancer Server Foren-Übersicht
Players:1/64    *Mod here*
Server Load:0 msec 
Deaths per Minute:0
logorechts  
  SERVERIP : 78.46.109.124:2302


 
  Portal  •  Forum-FAQ  •   Suchen  •  Registrieren  •  Einloggen, um private Nachrichten zu lesen  •  Login  
  Donation/Spenden  •   Donation List  •   Clan Statistik  •   HC Forum Rangsystem Info  •   Player Rankings  •   HC Universum Map  •   Banned Players  •   Bug Tracker  
/

   
 Play freelancer with a wiimote. Nächstes Thema anzeigen
Vorheriges Thema anzeigen
Neues Thema eröffnenNeue Antwort erstellen
Autor Nachricht
Nyar





Webmissions: 1


Beiträge: 18

Beitrag Titel: Play freelancer with a wiimote.
Verfasst am: 01.03.09 04:07
Antworten mit ZitatNach oben

Old post at bottom, it No longer matters.

I have My wii remote working with FL. its not 100% perfect, but once you understand how to calibrate it in game, it works great.

The next questions is, What do I map the keys too?





Zitat:
What X/Y mapping system does Freelancer use to track the mouse location? (full title, without character limit.)

Ive got glovepie, a wiimote, and freelancer.

given the similarities between games like freelancers, and metroid prime, i had the great idea of freelancer with a wii mote.

normally you can map the wiimote ir sensor to the mouse. The first script i found used absolute positioning. FL wouldnt accept that, the mouse just sat their without moving.

I changed it to a % of the screen, and tried that. it worked for the deskstop still, and worked, sort of, in freelancer. it jumps around alot.

based on some x/y debug info i got glovepie to spit out, actual coordinates of the mouse seem unrelated to the pointer location in game.

Given the awesome skill of the modders who built this mod, i figured someone might have some suggestions for me.


Zuletzt bearbeitet von Nyar am 02.03.09 02:27, insgesamt 2-mal bearbeitet
Nyar is offline Benutzer-Profile anzeigenPrivate Nachricht senden
[TCEagles]crashbx
Fleet Captain


financial_expert_silber time_bandit_gold basefinder_bronze jumpholefinder_silber

rpgchar

Playtime: 2237h
Webmissions: 1


Beiträge: 952

Beitrag Titel:
Verfasst am: 01.03.09 13:58
Antworten mit ZitatNach oben

try also make this topic on www.the-starport.com, there are lots of modders u might get an answer you seek. Good luck with solution. btw what kinda hardware is this you can connect Wii to PC and play games ? I would like to try Wii Freelancer also lol xD

_________________
Western Alliance - 301st TCEagles Squadron

Posted Image, might have been reduced in size. Click Image to view fullscreen.
[TCEagles]crashbx is offline Benutzer-Profile anzeigenPrivate Nachricht senden
[APHEX]
Lieutenant Commander


financial_expert_bronze time_bandit_gold basefinder_gold jumpholefinder_gold

rpgchar

Playtime: 3030h
Webmissions: 56


Beiträge: 2796
Wohnort: Sin-City // Honshu System

Beitrag Titel:
Verfasst am: 01.03.09 15:05
Antworten mit ZitatNach oben

he only connected the controller to the pc ^^
there are also some guys @ youtube who did that with half life and other games.

_________________
Posted Image, might have been reduced in size. Click Image to view fullscreen.
When you change the way you look at things, the things you look at change!
[APHEX] is offline Benutzer-Profile anzeigenPrivate Nachricht senden
Nyar





Webmissions: 1


Beiträge: 18

Beitrag Titel:
Verfasst am: 01.03.09 20:34
Antworten mit ZitatNach oben

[APHEX] hat folgendes geschrieben:
he only connected the controller to the pc ^^
there are also some guys @ youtube who did that with half life and other games.


Yeah, just the controller.

You need a bluetooth adapter, and a program called Glovepie.


http://www.wiili.org/index.php/Compatible_Bluetooth_Devices

http://carl.kenner.googlepages.com/glovepie

Like i said though, im having some difficulties with mouse tracking in game.



============
UPDATE
============

EVEN MORE, MORE TESTING

IVE GOT IT

well, sort of.

I was testing with a few other games, just to see how they reacted. Most worked ok, but there where a few that had problems. The one that inspired my newset idea was Black and white

Black and white uses an... Intresting control scheme. You are a god. So its kind of RTS like, only in allows pan/zoom on levels that no RTS has ever done well. The thing is, control works for the most part, until you want to start the pan and zoom features. In the game you click and drag the mouse. your mouse stays in position, while the game move around it.

The wiimote did not work for panning/zooming. The reason, I think, is that game game is listening for input from the mouse, rather then from an absolute screen position.

So, looking through the help files in glove pie, i found

mouse.directinputx
mouse.directinputy
mouse.directinputpos

Score. When i give commands from these, in some unit known as "micekeys" most of my games seem to have a decent response. The catch is, theres no easy way to convert the Wiimote.Dot1X into this other weird units of measure.

==================================

Now im looking for help.

Ive got most of what i need in place, i just need to figure out how to code it all.

If anyone is interested in learning an obscure programming language, so they can program a non-standard controller for use with an antiquated Game, let me know.

If i get it working, i Will release the code if someone is interested.
Nyar is offline Benutzer-Profile anzeigenPrivate Nachricht senden
Nyar





Webmissions: 1


Beiträge: 18

Beitrag Titel:
Verfasst am: 02.03.09 02:23
Antworten mit ZitatNach oben

Update March 5th

Old code was pretty precise, but if you didnt have a 100% steady hand, your mouse jumped all over the place. This one uses a smoother when your not moving fast. The result is that large movements are still 100% accurate, but when your pointing at one spot, it doesnt jump around as much.

Regular mouse is inverted while wiimote is pointed at the screen. for rigght now, just point the wii somewhere else while using the mouse.

theres some delay for percision movements, but i think its better then a dead zone, where it has to jump alot, or being super percise, where a not perfectly steady hand causes it to be impossible to click on things.



================================

OK, double posts are bad, but this is worth it.

If you got a bluetooth adapter, and glove pie, here is my first attempt at code for controlling freelancer.

Edit, made some tweaks to the code. Updated the comments to they now give you the actual results of all button presses.

Code:
//Mouse Control Script using IR
//by vkapadia with much assistance from inio
//vkapadia@vkapadia.com
//
//Calibration:
//
//
//
var.xtrim = 15
var.ytrim = -30
var.ztrim = 6
//
//Options:
var.deadzone = 1 //distance in pixels that you have to move the wiimote in
   //order for it to register movement. Creates a "dead zone" around the pointer
   //to make it easier to click. Higher = smoother but less accurate.

var.rumble = false //makes the wiimote rumble if you hit the edge of the screen
//more options to be added later

//Controls: Assume you use a default control Scheme
//Point Wiimote = Move Mouse

//Point Wiimote = Move Mouse

// analog = movement
W = Wiimote.Nunchuk.JoyY < -0.6
S = Wiimote.Nunchuk.JoyY > 0.6
A = Wiimote.Nunchuk.JoyX < -0.3
D = Wiimote.Nunchuk.JoyX > 0.3


// Add roll to either wiimote, or nunchuck

//Must bind left and right to the arrow keys

//Pitch up and down to their respective arrow keys as well.

//Left = wiimote.roll < -45
//Right = wiimote.roll > 45

Left = wiimote.Nunchuk.roll < -30
Right = wiimote.Nunchuk.roll > 30
Down = wiimote.Nunchuk.pitch > 30
Up = wiimote.Nunchuk.pitch < -30



//D-Pad = up=Cruise Down=Tractor Left=slow Right=dock
leftshift = wiimote.Up
W = wiimote.Up

b = wiimote.Down
x = wiimote.Left
F3 = wiimote.Right

//A-Button = Left Click, select, mousemode
//B-Button = Right Click Fir
Mouse.LeftButton = Wiimote.A
Mouse.RightButton = Wiimote.B
Space = Wiimote.one

//Plus = Bats and bots
//Minus next enemy
//Home = next target
   f = wiimote.plus
   r = wiimote.plus
   ^r = wiimote.minus
   t = wiimote.Home

//Nunchuk Cbutton Engine kill
//Z button Thrusters
Key.Tab = Wiimote.Nunchuk.ZButton
Key.z = Wiimote.Nunchuk.CButton

//wiimote.One Space bar, toggle mouse flight
//wiimote.Two
Space = Wiimote.one


var.KITTspeed = 200 ms //delay speed for flashing LEDs. higher = slower
//***Do not edit anything below this line unless you know what you are doing.***

//The LEDs attempt to emulate KITT's grill from Knight Rider

//LEDs look somewhat like KITT's grill from Knight Rider
if 0 = 0 then
  if var.kitt = 0 then
    wiimote.Leds = 1
  endif
  if var.kitt = 1 then
    wiimote.Leds = 3
  endif
  if var.kitt = 2 then
    wiimote.Leds = 6
  endif
  if var.kitt = 3 then
    wiimote.Leds = 12
  endif
  if var.kitt = 4 then
    wiimote.Leds = 8
  endif
  if var.kitt = 5 then
    wiimote.Leds = 12
  endif
  if var.kitt = 6 then
    wiimote.Leds = 6
  endif
  if var.kitt = 7 then
    wiimote.Leds = 3
  endif
  wait var.KITTspeed
  var.kitt = (var.kitt + 1) % 8
endif

//If the mouse reaches the end, rumble for 200 milliseconds
if var.rumble and (mouse.x = 0 or mouse.x = 1 or mouse.y = 0 or mouse.y = 1) then
  if var.rmbl = false
    wiimote.Rumble = 1
    wait 200 ms
    wiimote.Rumble = 0
  endif
  var.rmbl = true
else
  var.rmbl = false
endif

var.accx = wiimote.RawForceX + var.xtrim
var.accy = wiimote.RawForceY + var.ytrim
var.accz = wiimote.RawForceZ + var.ztrim

if wiimote.dot1vis and wiimote.dot2vis then

  if var.accy > -7 then
    var.orientation = 0
  elseif var.accy > -45 then
    if var.accx < 0 then
      var.orientation = 3
    else
      var.orientation = 1
    endif
  else
    var.orientation = 2
  endif

  if var.leftpoint = 0 then
    if var.orientation = 0 then
      if wiimote.dot1x < wiimote.dot2x then
        var.leftpoint = 1
      else
        var.leftpoint = 2
      endif
    endif
    if var.orientation = 1 then
      if wiimote.dot1y > wiimote.dot2y then
        var.leftpoint = 1
      else
        var.leftpoint = 2
      endif
    endif
    if var.orientation = 2 then
      if wiimote.dot1x > wiimote.dot2x then
        var.leftpoint = 1
      else
        var.leftpoint = 2
      endif
    endif
    if var.orientation = 3 then
      if wiimote.dot1y < wiimote.dot2y then
        var.leftpoint = 1
      else
        var.leftpoint = 2
      endif
    endif
  endif

  if var.leftpoint = 1 then
    var.fix1x = wiimote.dot1x
    var.fix1y = wiimote.dot1y
    var.fix2x = wiimote.dot2x
    var.fix2y = wiimote.dot2y
  else
    var.fix1x = wiimote.dot2x
    var.fix1y = wiimote.dot2y
    var.fix2x = wiimote.dot1x
    var.fix2y = wiimote.dot1y
  endif

  var.dx = var.fix2x - var.fix1x
  var.dy = var.fix2y - var.fix1y
  var.cx = (var.fix1x+var.fix2x)/1024.0 - 1
  var.cy = (var.fix1y+var.fix2y)/1024.0 - .75

  var.d = sqrt(var.dx*var.dx+var.dy*var.dy)

  var.dx = var.dx / var.d
  var.dy = var.dy / var.d

  var.ox = -var.dy*var.cy-var.dx*var.cx;
  var.oy = -var.dx*var.cy+var.dy*var.cx;

  var.ax = (var.ox * screen.desktopwidth) + (screen.desktopwidth / 2)
  var.ay = (-var.oy * screen.desktopwidth) + (screen.desktopheight / 2)




  var.dx = var.ax - mouse.cursorposx
  var.dy = var.ay - mouse.cursorposy

  var.d = sqrt((var.dx*var.dx)+(var.dy*var.dy))

  var.a = 180 / (200 + var.d * var.d * var.d * .001)

  if var.d <= var.deadzone then var.a = 1



  var.finalx = mouse.cursorposx * var.a + var.ax * (1 - var.a)
  var.finaly = mouse.cursorposy * var.a + var.ay * (1 - var.a)

  //Original Abs coords
//  mouse.cursorposx = var.finalx
//  mouse.cursorposy = var.finaly

  //Original Delta
//       mouse.directinputX = mouse.directinputX + delta(var.finalx)/10
//       mouse.DirectInputY = mouse.directinputY + delta(var.finaly)/10

 var.delx = mouse.directinputX + delta(var.finalx)/9
 var.dely = mouse.directinputY + delta(var.finaly)/9

  //newer smoother choice
//       mouse.directinputX = var.smoothx
//       mouse.DirectInputY = var.smoothy

       var.smoothx = (smooth((var.finalx),2,1)/10)
       var.smoothy = (smooth((var.finaly),2,1)/10)

// Auto switcher
var.mdx = Delta(var.finaly)
var.mdy = Delta(var.finalx)
//var.mdt = Abs(var.mdx) + Abs(var.mdy)
var.mdt = sqrt((var.mdx*var.mdx)+(var.mdy*var.mdy))

   if var.mdt > 50
     mouse.directinputX = var.delx
     mouse.DirectInputY = var.dely
      Debug = "Delta    Delta X, Y   "  + var.delX + ", " + var.smoothy + "   Smooth X, Y:   "+  var.smoothx + ", " + var.smoothy
   else if var.mdt < 50
     mouse.directinputX = var.smoothx
     mouse.directinputY = var.smoothy
      Debug = "Smooth   Delta X, Y   "  + var.delX + ", " + var.smoothy + "   Smooth X, Y:   "+  var.smoothx + ", " + var.smoothy
   endif

   


//  mouse.cursorposx = var.finalx
//  mouse.cursorposy = var.finaly

else

  var.leftpoint = 0

endif

//debugs
If var.key = "y"
 Debug =  var.dot1 + Var.dot2 + "   Delta X, Y   "  + var.delX + ", " + var.smoothy + "   Smooth X, Y:   "+  var.smoothx + ", " + var.smoothy
Endif
If var.key = "g"
 Debug = "Wiimote's Gs (X = " + Wiimote.gX + ")  (Y = " + Wiimote.gY + ")  (Z = " + Wiimote.gZ +")"
Endif
if var.key = "pr"
debug = "roll=" + var.roll + "      pitch=" + var.pitch + "     Nunchuk roll=" + wiimote.Nunchuk.Roll + "      pitch=" + wiimote.Nunchuk.pitch
endif
If var.key = "m"
 Debug = " Mouse Location: X= " + Mouse.x + " AbsX " + mouse.CursorPosX + "       Y= " + mouse.y + " AbsY " + mouse.CursorPosY + " ??? " + mouse.directinputy
Endif

If key.Left = "True"
  mouse.directinputx = mouse.directinputx - 1
Endif

if g = true
var.key = "g"
endif
if y = true
var.key = "y"
endif
if (r) or (p) = true
var.key = "pr"
endif
if m = true
var.key = "m"
endif
// varibles
var.dot1 = "Dot 1: (X =" + Wiimote.Dot1X + ") (Y =" + Wiimote.Dot1Y + ") (Size = " + Wiimote.Dot1Size + ")"
Var.dot2 = "    Dot 2: (X =" + Wiimote.Dot2X + ") (Y =" + Wiimote.Dot2Y + ") (Size = " + Wiimote.Dot2Size + ")"
var.ox = wiimote.dot1x
var.oy = wiimote.dot1y
var.pitch = wiimote.Pitch
var.roll = wiimote.Roll
//debug = var.accx + " x " + var.accy + " y " + var.accz + " z"   */
//Do not add a batter check, it has a conflict with the nunchuck, and causes phantom presses of the analog stick.



Im still working on it, and could really use some suggestions.

I stole the IR tracking code out of someone else's tool, and just tweaked it to meet my needs, so i am NOT a great coder, just good at altering other peoples stuff.


Zuletzt bearbeitet von Nyar am 05.03.09 09:31, insgesamt einmal bearbeitet
Nyar is offline Benutzer-Profile anzeigenPrivate Nachricht senden
Tobear





Webmissions: 6


Beiträge: 432
Wohnort: New Providence

Beitrag Titel:
Verfasst am: 02.03.09 11:13
Antworten mit ZitatNach oben

Nice work dude (and of course of the dude you have stolen some parts of his code^^). Maybe I will borrow my brothers Wii-Mode for some days and will try it, too

_________________
Posted Image, might have been reduced in size. Click Image to view fullscreen.
"If we don't succeed in this, we're pretty fucked..." - Serj Tankian
Tobear is offline Benutzer-Profile anzeigenPrivate Nachricht senden
Nyar





Webmissions: 1


Beiträge: 18

Beitrag Titel:
Verfasst am: 02.03.09 18:36
Antworten mit ZitatNach oben

Im kinda upset about some parts though.

The lights at the bottom used to be a battery indicator.

problem was, whenever it checked the battery status, it would cause the nunchuck to act as if i Hit Down right.

Down was linked to X, which is to fly backwards. It will also kick you out of cruise mode. Sadly the battery function had to go.

Theres a way to check pixels on screen, and see what color they are. Im wondering if i can target the shield bar, and make the lights match shields.

---

If the next update of the mod includes the roll ability, i could psudo map it to the wii mote, or nunchuck roll.

=====

Im playing with this from work, where i dont have access to test it. Instead, i will use this post to send myself some notes.

Code:
Smooth(x, [ExtraFrames, [DeadbandDistance]])

Smooths out the value of x by averaging with the previous ExtraFrames frames. If it hasn’t changed by more than DeadbandDistance it doesn’t count as changed at all. By default


Try that around the delta, see if that makes it eaiser to navigate menus.

Code:
NEW! Pixel colour Functions
ScreenPixel(x, y): colour of screen pixel at (x, y) as an integer, in hexadecimal it looks like 0xRRGGBB. This is the opposite of the way the windows DLLs do it, but it is the way the internet and DirectX do it. To display it:

Debug = “0x”+ IntToHex(ScreenPixel(0, 0), 6)

You can also treat it like a vector:

[var.r, var.g, var.b] = ScreenPixel(0, 0)

debug = var.r+’, ‘+var.g+’, ‘+var.b

That will set var.r, var.g, and var.b to the values between 0 and 1 corresponding to the amount of red, green, and blue in the colour. The (0, 0) coordinates could be any pixel coordinates.


Pixel finder. For use with the wii mote LED's. See if i cant make it check four points along the bottom middle, and see if the shield is up.
Nyar is offline Benutzer-Profile anzeigenPrivate Nachricht senden
Beiträge der letzten Zeit anzeigen:      
Neues Thema eröffnenNeue Antwort erstellen


 Gehe zu:   



Nächstes Thema anzeigen
Vorheriges Thema anzeigen
Du kannst keine Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum nicht antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.


 



Spielecke
Last 10 Deaths


Google





   
  5 users on website
powered by 230 volt, phpBB with modifications by Niwo. Alle Zeiten sind GMT + 1 Stunde
This page has been viewed 221166084 times.
Servertime: 00:14:09 Current server uptime: 264 days, 0 users, load average: 0.07, 0.06, Server Disk Space free: 23153 MB


Spendenkontostand / donating account balance
Page generation time: 0.2059s (PHP: 79% - SQL: 21%) - SQL queries: 20 - GZIP disabled - Debug off