09-05-15, 15:41 | #1 | |||
Member
Joined: Mar 2009
Posts: 1,502
|
TRNG - [LOW] Less Objects in World to prevent framerate issue
This tutorial will help you to increase the framerate in game - especially on some agging computer - without decreasing the quality of your work on other computers. LOW Option - the ability for player to increase or lower details in game (in real time): TRNG allows us to play with statics and make them invisible, then visible. If you manage this with some condition GlobalTrigger and TriggerGroup, you can create a new option that able the player to choose the amount of detail viewable in the level... And so prevent some lagging on aging computers, still letting these players able to see - time by time - how was intended to be the level Optimizing is the key: Follow this link to read an useful handbook made by Titak and gathering tips to reduces lagging from other like teme9 Settings: ;-- Enable LOW Option with F8 keyboard Code:
GlobalTrigger= 21, IGNORE, GT_KEYBOARD_CODE, 66, IGNORE, 125, IGNORE TriggerGroup= 125, $2000+TGROUP_SINGLE_SHOT_RESUMED, 204, $C, > ;Remove text from GT22 $2000, 189, $xxx, [...], > ;Flipeffects hide statics $2000, 345, $7F, $2000, 203, $10B, $2000, 374, $16, $2000, 375, $15 ;Enabled TG127, Print TextonScreen +GT22 -GT21 TriggerGroup= 127, $2000+TGROUP_SINGLE_SHOT_RESUMED, 189, $xxx, $2000, 189, $xxx, [...] ;Flipeffects hide following statics The middle that gathers the flippeffect trigger to make invisible the static: "$2000, 189, $xxx" - 189 is the ID for Hide Static and the "xxx" has to be the number of your statics in hexadecimal, after the "$" symbol. You can get an hexadecimal convertor here, so no need to always export your script trigger. The third line gather all the setting to print a text on screen - so player is awer he has hit F8 Keyboard. The text printed used the flippeffect: "$2000, 203, $10B" show ExtraNG string 11 (see below) with PARAM_PRINT_TEXT, 1. (Take care to not mistake with PARAM_WTEXT.) Then we disable this GlobalTrigger:21 and enable the next one:22 with "$2000, 374, $16, $2000, 375, $15". I also added a trigger to activate an other TriggerGroup:127 "$2000, 345, $7F". In fact, when you have too much flipeffect "Hide Static", the script won't work so well and can even crash. So I advise you to not exceed 70 triggers per TriggerGroup. And of course the first line (that I deliberated forget) "$2000+TGROUP_SINGLE_SHOT_RESUMED, 204, $C" anticipate the next GlobalTrigger and erase its text that could print over - it prevent text to be unreadable at last. "$C" value is linked to the ExtraNG strings 12 (see below) which has to be clear from screen if still viewable. ;-- Disabled LOW Option with F9 keyboard Code:
GlobalTrigger= 22, FGT_DISABLED, GT_KEYBOARD_CODE, 67, IGNORE, 126, IGNORE TriggerGroup= 126, $2000+TGROUP_SINGLE_SHOT_RESUMED, 204, $B, > ;Remove text from GT21 $2000, 190, $xxx, [...], > ;Flipeffects show statics $2000, 345, $80, $2000, 203, $10B, $2000, 374, $16, $2000, 375, $15 ;Enabled TG127, Print TextonScreen +GT22 -GT21 TriggerGroup= 128, $2000+TGROUP_SINGLE_SHOT_RESUMED, 190, $xxx, $2000, 190, $xxx, [...] ;Flipeffects show following statics Of course in both TriggerGroup enabled, I used TGROUP_SINGLE_SHOT_RESUMED to prevent ;-- Text to print Code:
Parameters= PARAM_PRINT_TEXT, 1, CL_WHITE, FT_UNDER_LEFT_BARS + FT_SIZE_ATOMIC_CHAR, IGNORE, 4, IGNORE, IGNORE Parameters= PARAM_PRINT_TEXT, 2, CL_WHITE, FT_BOTTOM_CENTER + FT_SIZE_ATOMIC_CHAR, IGNORE, 3, IGNORE, IGNORE Quote:
Quote:
Quote:
Customizable and Advise: ;-- Improve Of course you could improve the script. Maybe you could use a Switch or Organizer line script to only use one Keyboard. The fact is if you want to only use one keyboard you have to take care player won't hit the keyboard too long time and freeze the game between the two GlobalTrigger. Though you could use variable to set some more conditions to be checked - especially if you use flipmap or... who's know. But we only have a limited number of variable You can also use this setting to render an automic "MIP" option... But as much as I've looked for this - it seems it won't really be possible. More investigation to come ;-- Test & Test Sometimes it will crash because you type the wrong hexa number (when you write up to 200 of those it happens). So keep calm and delete line by line to spot where it crashes... then trigger by trigger. You'de better use the ",>" symbole to skip lines as I did. One good point, is that there's mostly no need to compile level since it's only scripting. ;-- Flipmap Take care with flipmapping it seems, you could get some "issues". For what I've tested some statics I set invisible in the the first room where already set invisible in the flipmap... but I didn't set those ones - from the flipmap - as invisible in my script. I also had very few other statics linked to a flipmap being invisible (that they shouldn't) when I wrote in my script both statics (in normal and flipmap room) have to be invisible. It seems object ID from a normal room to a flipmap room can be tricky! It needs more test from me - but my level had some issues not related to this feature. So that my be the reason why. NOTA BENE: Still in work! Do not reply here... you can discussed of this on my personal thread or open a new thread in the NGLE Section. Last edited by Level NextGen; 09-05-15 at 16:48. |
|||
09-05-15, 15:51 | #2 | |||
Member
Joined: Mar 2009
Posts: 1,502
|
Automatic LOW Option:
You are fed up to trigger every flame emitter ON and OFF when you get out and enter a room. Here is a way to do so automatically. Of course it's based on this "LOW option". All you need is scripting and it can be done with moveable and static. Though you might write lots of lines. ;-- The Script Code:
GlobalTrigger= 31, IGNORE, GT_DISTANCE_FROM_ITEM, 83887547, IGNORE, 160, 161 ;From 10blocks Flame1467 TriggerGroup= 160, $5000+TGROUP_SINGLE_SHOT_RESUMED, 2147, $2B ;Trigger TriggerGroup= 161, $5000+TGROUP_SINGLE_SHOT_RESUMED, 2147, $80E ;Untrigger The formula has to be set in the Parameter field and work that way Quote:
And TG161 will kill the flame emitter with an Action Trigger "Enemy. Kill object in Disable emitter way" when Lara is away. I've tried to set a FGT_SINGLE_SHOT_RESUMED but it doesn't work properly with GT_DISTANCE, so you will have to set in TriggerGroup +TGROUP_SINGLE_SHOT_RESUMED (so your GlobalTrigger won't play indifinetly until the next condition). ;-- Moveable or Static If you want to do so with a static, it won't be the same as a moveable. You will have to use for :
The formula is of course the same. What has been told in the previous part with statics made invisible by player, is now possible in an automatic way when Lara is not near them. If you combine this with a fog you can create smooth render. ;-- Too much objects to do? If you have too much object to verify and there are near each other. I advise you to use one (centered) as a dummy to trigger and untrigger every one. Or you could use another dummy invisible item as the condition distance to verify. Here is an example made by me: Code:
GlobalTrigger= 28, IGNORE, GT_DISTANCE_FROM_ITEM, 41944310, IGNORE, 154, 155 ;From 5blocks WaterfallTrapdoor Steams 1270(+3 next to it) TriggerGroup= 154, $5000+TGROUP_SINGLE_SHOT_RESUMED, 1277, $2B, $5000, 1272, $2B, $5000, 1270, $2B, $5000, 1274, $2B ;Trigger TriggerGroup= 155, $5000+TGROUP_SINGLE_SHOT_RESUMED, 1277, $80E, $5000, 1272, $80E, $5000, 1270, $80E, $5000, 1274, $80E ;Untrigger Of course you can still use the Condition trigger field to check if there are other conditions. It can be useful when you have many rooms next each other but separated with walls. Like in this example, you would prefere that flame emitter in the next room aren't triggered. So you can either make disabled the GT with FGT_DISABLED and set a Enable GT Trigger when you enter this room or aera. But wait it can be like the automatic option is finaly useless So you can use a Condition trigger to check if Lara is in those rooms. Well I don't really understand how it works for now but I'm sure it links to this trigger - some more test to be done : Quote:
You can also use this extra line when you want to only use the GT-Distance in a planar mode : GTD_IGNORE_HEIGHT Let's hear what Doctor TRNG has to say Quote:
Which Object should I make invisible: You might ask what had to be set invisible/disabled in large distance. Here are some tips ;-- Semi-Transparent & Magenta These are the ones that can reduce the framerate of the game. If you have lots of semi-transparent objects, the engine will take more time to compute them. So you better reduce there numbers with those technic explained. Same with shiney textures. ;-- Hi-poly Of course Hi-poly object can reduce A tip is to use the LOW option as a MIP option (mostly for statics because there's an ANIMATING_MIP script command), instead of just making invisible the object you can replace it by a lower-poly one. Or make your objects as different parts. Imagine a tree with less leaves, and an "add-on" with more leaves and roots that you can disable in distance Take care with the limits of objects per room... ;-- Animatings or Statics? And so Animatings or Statics? Static! mostly because they take more time to be computed as they have an inner lighting - they do not react to the room lighting. But you can still do so with animatings that used lots of semi-transparent or shiney textures Last edited by Level NextGen; 16-05-15 at 16:55. |
|||
Thread Tools | |
|
|