Game Development Community

Incorporating new code

by Omri Perez · in Technical Issues · 08/19/2008 (6:53 am) · 2 replies

Hello Everyone,
As I have said somewhere else on the garagegames forums, i'm a phd student
and I used tge 1.5 to make a nice psychological experiment.

In this experiment I need to output "triggers" to a recording device. I first used audio but it
turned to be inaccurate jittering over +-100ms in time.

I decided to go to a lower level and use the serial port.

Rui Barbosa said I should look at this c++ code to use the serial port:

http://www.fogma.co.uk/foggylog/archive/140.html

This could be very helpful, but I don't know how to incorporate it into the build nor how to build.

I guess I could find out how to compile the whole thing If I read enough into the forum.
But I have no idea how to incorporate this code...

thanks in advance,
Omri P.

#1
08/20/2008 (6:33 am)
Hello Omri.

I am still learning how to use to the engine's source code.
I have some experience with C++, but really am still learning the basics of the engine.
Right now, I don't know exactly where to fit the serial output, but I am learning fast.

I believe I am going to be able to help in a week or so.

Here's how I will do it:

1. Modify main() in the example C++ serial port code, and rename it to something like "writeToSerialPort()".
2. I am going to add a console function, called "writeToSerialPort()".

Aas a matter of fact, I believe I know enough about how to do that. I may try it tonight.
But I am nt sure I know enough of the engine, in order to do that.

Anyway, I am going to know how to do it real soon.

Another thing we could try is I could modify the C++ code from the example and someone here on the forums would be kind enough to create a new console command that invokes that function.

Cheers,

Rui
#2
09/10/2008 (1:15 am)
New stuff,
Turns out the scheduler of the game engine is not accurate enough for my purposes.
How would one go about making it more accurate, perhaps giving it a seperate thread?

Also I would still like to incorporate the serial output, if someone is willing to guide me...

thanks in advance,
Omri