After i thought of adding thousand of block-models to my level, i tested it. At the end, the fps are unter 5.. really tooooo low ^^.
Now my new question about that:
If i create a BIIIG Block-Model. How i´m able to split it into 100x100 Faces ( from top view ) and 100x400 Faces( from sideview ).
AND..
How i´m able to select the top 100x100 face, and delete the complete miniblock under it. But adding texture to the hole-walls. The upper edge that´s facing to the hole, should be curved down a bit..
What i want to get:
That must explain all ^^
2. question:
Red = Floor in the Center of the Screen. ( the fix point ) green = An ENtity called "camobject"
I want "camobject" always watch into the direction of the floor point, and rotate around it. "camobject"´s Tilt is -50 and won´t change.. Problem: I´ve a Existing Script for the camera movement. And i can´t change it completely, because 11 other Scripts are using that code ( don´t want to change them all ).. So here´s the Script:
on holding Pos1/Q or End/E => Save (X,Y,-155) of the Screen-Center Rotate the camobject around it, and don´t change tilt ( but looking at these 3 points ).
After i thought of adding thousand of block-models to my level, i tested it. At the end, the fps are unter 5.. really tooooo low ^^.
My game consists of a cube filled with 17x17x17 blocks, meaning ~5000 blocks. Those are simple cubes consisting of round and about 18 faces each. I get a framerate of 17 fps. So I don't know how you managed to get 5fps, but they must be very complex blocks...
Well, eventhough 17fps is a little more, it's still too low for me as I need to apply a number of various effects which will eat performance as well. Therefore I will remove every side of a block that is not visible by the player. I know this by just checking if surrounding blocks are covering a block (I keep track of 'em with a large array), and if so, you can remove that side (e.g. by not placing a side model there, or placing a block model missing one side). I think there are also certain vertex shaders that can do this. Not rendering the back culling vertexes. That would be even a better way, but I'm not yet sure if it's that easy to achieve.
Quote:
How i´m able to select the top 100x100 face, and delete the complete miniblock under it. But adding texture to the hole-walls. The upper edge that´s facing to the hole, should be curved down a bit..
Once you know where your blocks are located, you know where the holes are and replace the blocks next to a hole with curved blocks. In my case, I have water flowing through my blocks, and I needed to know if there was a 'hole' to place a waterfall, or to end a waterfall when reaching ground, to start spreading water again. You just basically have to do alot of thinking when what should happen.
I want "camobject" always watch into the direction of the floor point, and rotate around it. "camobject"´s Tilt is -50 and won´t change..
Play a little around with the vec_ functions.
-vec_to_angle can let your cam watch into the direction of something (example in the manual). -vec_for_angle can let you put the cam in a position somewhere around the object. Create a new vector which should be your "rotation vector". You rotate this vector to rotate the cam around. -vec_scale can let you scale the camera way from the object after you applied vec_for_angle. Negative scaling means moving away from the object backwards, which you want. Add some Z and you're done.
Last edited by Joozey; 08/07/0802:19.
Click and join the 3dgs irc community! Room: #3dgs
Re: Destroy a block-model && Cam rotation around a fix point
[Re: Joozey]
#220344 08/07/0803:1308/07/0803:13
excuse my naivety, but why are you having all the blocks underneath?
surely you can just have the 100x100 blocks (saving you 30000 blocks (75%)) and change their scale to match up with what they're doing and the bottom blocks would be doing?
scale_z to .25 or start at 400? then reduce it down changing the texture and the position to what you need? probably you'll be doing half of that anyway...?
just a thought
Re: Destroy a block-model && Cam rotation around a fix point
[Re: MrGuest]
#220505 08/07/0812:4608/07/0812:46
because the Blocks are a bit more complex Their roof is not flat, and tey´re stretched, whirled and morphed a bit on each vertex, to let em look like a earthcube.. First they´re just 30-Faces Cubes.. But after the imps make he walls stronger, the cubes at the dungeon walls morph to those: http://www.box.net/shared/osqgsofy8o
Why do you need 400 faces in height? It it really necessary?
Knowing Dungeon Keeper as I do from the old days, there was only the 100x100 single-height blocks and a floor plane beneath them.
The appearance of 'breaking up" on diging was only animation frames of the dirt-block or wall-block in action. This same animation sequence also used in the FPS looking "Beast POV" and was quite noticable there.
Couldnt you do the same? Or are you looking at making a 3D version of Dungeon keeper with up/down as well as the old north/south digging? I would love to see that come to fruition!!!
If you decide it IS necessary, another way to try it would be to create the entities on-the-fly from inside lite-c rather than WED, and see if it behaves any better. I have found that Lite-C generated entities seem to behave more efficiently than WED planted ones.
Hope this helps.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
Re: Destroy a block-model && Cam rotation around a fix point
[Re: EvilSOB]
#220826 08/10/0800:0308/10/0800:03
only the 100x100 single-height blocks and a floor plane beneath them.
What sais me, that you haven´t set the block high inside the menu to max ^^. The Dungeon keeper2 Models of the Blocks are 100x100x400 ( extract via Data reader ).
I tried to create the entities on-the-run.. But the game hang off. and if i put a wait into the while-loop, the loading time of a 500x500 Level could be.. LOOOOOOOOOOONG. Tried the code from the fog-of-war in AUM for the wall too.. same problem.
So i need a script that is able to do the things asked in question 1.
Ah, sorry.I though you meant 100 blocks wide by 100 blocks high by 400 blocks thick. My bad...
Ive done some testing and I see what you mean, FPS drops badly when the quantity of entity climbs. The more complex the model is also adds to this problem. I can only see more CPU power solving this, but Hey, Im only a noob to Gamestudio so I could easily be wrong.
But while I was testing, I put the following CAMERA code together from scraps and documented it properly. Hope this helps.
And best of luck finding a result, I'm curious myself now...
Code:
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Complete Camera Management function
//
VECTOR* CamTarget = { x=0; y=0; z=0; } //Globally accesable Target of camera
VECTOR* CamOffset = { x=0; y=0; z=0; } //Globally accesable X,Y,Z Offset of Focus. ie (0,0,0) = dead-on CamTarget
var CamZoomFactor = 50; //Globally accesable ZOOM setting of camera
//
//
function Camera_Driver_startup()
{
while(1)
{
//Optionally place limitations on available angles/positions
camera.pan = clamp(camera.pan, -175, 175); //Limit possible Pan angle to keep Camera from Panning completely around
camera.tilt = clamp(camera.tilt, -90, 0); //Limit possible Tilt angle to keep Camera "above" play-field
camera.roll = clamp(camera.roll, 0, 0); //Limit possible Roll angle to disabled
//
//Position and Focus Camera
camera.x = CamTarget.x + CamOffset.x - CamZoomFactor * cos(camera.tilt) * cos(camera.pan);
camera.y = CamTarget.y + CamOffset.y - CamZoomFactor * cos(camera.tilt) * sin(camera.pan);
camera.z = CamTarget.z + CamOffset.z - CamZoomFactor * sin(camera.tilt);
//
//
proc_mode = PROC_LATE;
wait(1);
}
}
//
//
function Example_Camera_Controls_startup()
{
VECTOR* Offset = vector(0,0,0);
while(1)
{
//Rotate/Zoom Camera
if(key_pressed(280)) camera.pan -= mickey.x/5; // mouse movement left-right changes PAN (when LeftClick held)
if(key_pressed(280)) camera.tilt -= mickey.y/5; // mouse movement up-down changes TILT (when LeftClick held)
CamZoomFactor += mickey.z / 25; // mouse Scroller up-down changes ZOOM (Anytime)
//
//Change Positional Offset of Focus away from Target. ie (0,0,0) = dead-on target
if(key_pressed(72)) CamOffset.x += time_step * CamZoomFactor / 25; // Up Arrow Adjust 'North'
if(key_pressed(80)) CamOffset.x -= time_step * CamZoomFactor / 25; // Down Arrow Adjust 'South'
if(key_pressed(75)) CamOffset.y += time_step * CamZoomFactor / 25; // Left Arrow Adjust 'East'
if(key_pressed(77)) CamOffset.y -= time_step * CamZoomFactor / 25; // Right Arrow Adjust 'West'
if(key_pressed(71)) CamOffset.z += time_step * CamZoomFactor / 25; // Home Key Adjust Camera Height 'Up'
if(key_pressed(79)) CamOffset.z -= time_step * CamZoomFactor / 25; // End Key Adjust Camera Height 'Down'
//
//
proc_mode = PROC_EARLY;
wait(1);
}
}
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Last edited by EvilSOB; 08/10/0818:46. Reason: Added comment and code.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
Re: Destroy a block-model && Cam rotation around a fix point
[Re: EvilSOB]
#220906 08/10/0818:4408/10/0818:44
My Problem now: The creating of the Models needs much time... Creating 100 Horizonal and 100 Vertical Entities needs more than 4 Minutes.. And that without a wait in teh code...
Perhaps you know why?
Ps.: After playing through DK2 last night ( yes.. only one night for the complete game )... i think a level maximum of 200-row x 200-column Models is enough. I think i won´t go over 100x100.. ^^ But the game still crashes...
Sorry, but I cant get it to run at all, too many missing includes, add on the language barrier and Im stuck....
Anyway, Ive looked at the main builder loop in Bitmap1 and tried to fine tune it a bit. Be carful to hang on to your old code though as this has not even been compiled, let alone tested.
Let us know if it "improves" things at all.
PS Try to put your IFs im order of Most-Common Block(First) to Least-Common Block(Last)