Large worlds?
by Jon C · in Torque Game Engine · 09/05/2005 (9:41 pm) · 87 replies
I'm considering Torque for a project, but wanted to know something first:
Does Torque allow for large worlds? In any way, whether it be linked 'missions' (Or whatever Torque calls it maps), or an entire object.
If not, does Torque's framework allow for such an edit, to the terrain engine? Its not that hard to change in general, but I'm mostly concerned about the mission editor.
Does Torque allow for large worlds? In any way, whether it be linked 'missions' (Or whatever Torque calls it maps), or an entire object.
If not, does Torque's framework allow for such an edit, to the terrain engine? Its not that hard to change in general, but I'm mostly concerned about the mission editor.
#82
I began looking at the other demos beside tutorial.base and GG searches on the topic.
FPS Starter Kit: I plugged in 8 missions along with the stronghold missions. All missions loaded except the player data resets to the initial values. Also I used the esc key to change missions...there is an idea here. I will try using globals to maintain values.
The GG searches on the topic are minimal. There is one source that discusses the "Common Script": 3D Game Programming All in One, by Kenneth Finney, Chap 7, p235. All the demos work from the same "common" directory (folder). Any changes here will affect them all. I am impressed in how the loading and unloading of missions where the subroutines are enterwoven among the common folder, the control (demos) folder and within themselves between the client and server. Finney has a figure (p.250) that shows this mission download process. It is amazing.
Argument: If I can change missions by using the esc key, then missions can be switched. Instead of using the escape key to change missions, I'll try the onLeaveMission callback with the same statements as the esc key. The spawning of the player at the mission joining the mission exited must be at the same exit point but at the opposite end of the exit axis. (The player values will have to wait.) I will look at the common code also to see if there is any advantages I may take there. Any comments on the spawning point are welcomed.
I have read all comments above...thank you but I want to try using the onLeaveMission callback as a trigger to switch from one mission to another. Hopefully I can set up spawning coordinates so a symmetrical transition will occur from one mission to another.
Jesse.
07/23/2006 (2:00 pm)
An adventure singleplayer game using several missions:I began looking at the other demos beside tutorial.base and GG searches on the topic.
FPS Starter Kit: I plugged in 8 missions along with the stronghold missions. All missions loaded except the player data resets to the initial values. Also I used the esc key to change missions...there is an idea here. I will try using globals to maintain values.
The GG searches on the topic are minimal. There is one source that discusses the "Common Script": 3D Game Programming All in One, by Kenneth Finney, Chap 7, p235. All the demos work from the same "common" directory (folder). Any changes here will affect them all. I am impressed in how the loading and unloading of missions where the subroutines are enterwoven among the common folder, the control (demos) folder and within themselves between the client and server. Finney has a figure (p.250) that shows this mission download process. It is amazing.
Argument: If I can change missions by using the esc key, then missions can be switched. Instead of using the escape key to change missions, I'll try the onLeaveMission callback with the same statements as the esc key. The spawning of the player at the mission joining the mission exited must be at the same exit point but at the opposite end of the exit axis. (The player values will have to wait.) I will look at the common code also to see if there is any advantages I may take there. Any comments on the spawning point are welcomed.
I have read all comments above...thank you but I want to try using the onLeaveMission callback as a trigger to switch from one mission to another. Hopefully I can set up spawning coordinates so a symmetrical transition will occur from one mission to another.
Jesse.
#83
Well I got to work, the main routine is below:
function Armor::onLeaveMissionArea(%this, %obj)
{
edited: deleted contents
Sorry - because there was a lack of comments.
}
I end up exactly at the point of exit except at the opposite side AND I had to do a little manipulation to set player inside the missionArea. For example, I am leaving map 10 going south to map 20, so I find that y = -792.2 on exit. So I increment the map by 10 to give 20. Next, I get the fraction of -792.2 and multiply -2 to get 0.4. I add the result to -792.2 to get -791.8. Finally I change the sign to get 791.8 which is the north side of map 20 just within the missionArea.
Remember that the maps overlap 64 pixels or 512 wu. So when leaving from one terrain to another, they look axactly alike. I was initially going to set the missionArea at 32 pixels which is the halfway point in the overlap but I decided to go more towards the squareSize8 of 29 pixels from its border and that is where the value 792wu comes from. Again I may change this later because I am still trying to get a feel in how long a world unit(wu) is.... Thus when player transfers from map 10 to map 20 he is in an identical area, so all tranform coordinate values remain the same except either x or y.
Jesse
07/24/2006 (12:02 am)
An adventure singleplayer game using several missions:Well I got to work, the main routine is below:
function Armor::onLeaveMissionArea(%this, %obj)
{
edited: deleted contents
Sorry - because there was a lack of comments.
}
I end up exactly at the point of exit except at the opposite side AND I had to do a little manipulation to set player inside the missionArea. For example, I am leaving map 10 going south to map 20, so I find that y = -792.2 on exit. So I increment the map by 10 to give 20. Next, I get the fraction of -792.2 and multiply -2 to get 0.4. I add the result to -792.2 to get -791.8. Finally I change the sign to get 791.8 which is the north side of map 20 just within the missionArea.
Remember that the maps overlap 64 pixels or 512 wu. So when leaving from one terrain to another, they look axactly alike. I was initially going to set the missionArea at 32 pixels which is the halfway point in the overlap but I decided to go more towards the squareSize8 of 29 pixels from its border and that is where the value 792wu comes from. Again I may change this later because I am still trying to get a feel in how long a world unit(wu) is.... Thus when player transfers from map 10 to map 20 he is in an identical area, so all tranform coordinate values remain the same except either x or y.
Jesse
#84
07/24/2006 (5:07 am)
That's pretty cool! I'll have to rewrite it for a bit, but the idea is great. Thanks
#85
There is a potential problem in the above routine: function Armor::onLeaveMissionArea(%this, %obj)
When the player approaches any of the four corners of the missionArea, it will not capture the conditionals when both x and y are greater than the missionArea of 792.
I have rewritten the last part of the routine to show:
// Perform loading
if (!%flag)
{
edited: deleted contents
Sorry - because there was a lack of comments.
}
The supporting functions for the above routine are:
function mapCycle()
{
edited: deleted contents
Sorry - because there was a lack of comments.
}
function mapCyclePause()
{
edited: deleted contents
Sorry - because there was a lack of comments.
}
Finally I had to use a Boolean global "$spawnBool" that is initially set to false in the server/init.cs. Then in GameConnection::onLeaveMissionArea it is set to true. In GameConnection::spawnPlayer I test the boolean to create a player using "$gNewTransform" global.
Please any comments....
Jesse.
07/26/2006 (2:20 pm)
An adventure singleplayer game using several missions:There is a potential problem in the above routine: function Armor::onLeaveMissionArea(%this, %obj)
When the player approaches any of the four corners of the missionArea, it will not capture the conditionals when both x and y are greater than the missionArea of 792.
I have rewritten the last part of the routine to show:
// Perform loading
if (!%flag)
{
edited: deleted contents
Sorry - because there was a lack of comments.
}
The supporting functions for the above routine are:
function mapCycle()
{
edited: deleted contents
Sorry - because there was a lack of comments.
}
function mapCyclePause()
{
edited: deleted contents
Sorry - because there was a lack of comments.
}
Finally I had to use a Boolean global "$spawnBool" that is initially set to false in the server/init.cs. Then in GameConnection::onLeaveMissionArea it is set to true. In GameConnection::spawnPlayer I test the boolean to create a player using "$gNewTransform" global.
Please any comments....
Jesse.
#86
10/02/2006 (12:36 am)
I have taken advice and bought the shader earlier adopter engin, now I just need to learn how to use atlas.
#87
Sorry this post has been moved to a Blog (resource). Click Here
11/07/2006 (7:23 am)
I have received email to re-post the subroutines for "An adventure singleplayer game using several missions:" listed above....Sorry this post has been moved to a Blog (resource). Click Here
Torque Owner Carpenter Software
I am a Mac User, is it possible to use ATLAS in TGE with out too many problems? From what I understand, TSE is not yet setup to run in the Mac.
I want to experiment with loading new missions eventhough it will not be seemless. I have been playing with the missionArea where I have the following results from the console:
PlayerShape::onLeaveMissionArea
common/ui/ConsoleDlg.gui (176): Unable to find function deactivateKeyboard
common/ui/ConsoleDlg.gui (170): Unable to find function activateKeyboard
tsm doc Deactivated
creator/editor/EditorGui.cs (844): Unable to find object: '' attempting to call function 'open'
creator/editor/EditorGui.cs (0): Unable to find object: 'MessageHud' attempting to call function 'close'
Obj: Observer -
Obj: WayPointMarker - Misc
Obj: SpawnSphereMarker - Misc
Obj: PlayerDts -
Obj: PlayerShape -
Obj: TorqueLogoItem - Items
Obj: Observer -
Obj: WayPointMarker - Misc
Obj: SpawnSphereMarker - Misc
Obj: PlayerDts -
Obj: PlayerShape -
Obj: TorqueLogoItem - Items
tsm doc should be active
tsm doc Deactivated
Could not locate texture: creator/data/terrains/grassland/grass
tsm doc Deactivated
pushDialog(): Invalid control: DemoEditorAlert
common/ui/ConsoleDlg.gui (176): Unable to find function deactivateKeyboard
common/ui/ConsoleDlg.gui (170): Unable to find function activateKeyboard
PlayerShape::onEnterMissionArea
common/ui/ConsoleDlg.gui (176): Unable to find function deactivateKeyboard
common/ui/ConsoleDlg.gui (170): Unable to find function activateKeyboard
tsm doc Deactivated
creator/editor/EditorGui.cs (844): Unable to find object: '' attempting to call function 'open'
creator/editor/EditorGui.cs (0): Unable to find object: 'MessageHud' attempting to call function 'close'
Obj: Observer -
Obj: WayPointMarker - Misc
Obj: SpawnSphereMarker - Misc
Obj: PlayerDts -
Obj: PlayerShape -
Obj: TorqueLogoItem - Items
Obj: Observer -
Obj: WayPointMarker - Misc
Obj: SpawnSphereMarker - Misc
Obj: PlayerDts -
Obj: PlayerShape -
Obj: TorqueLogoItem - Items
tsm doc should be active
tsm doc Deactivated
Could not locate texture: creator/data/terrains/grassland/grass
tsm doc Deactivated
pushDialog(): Invalid control: DemoEditorAlert
As I leave and enter the missionArea, there is lot happening as shown above. Is there anyone who can explain in general what is going on?
Jesse
After playing with tutorial.base, I realize I had misinterpreted the output on the console but also I had learned to use the console to my benefit. Jesse.