Always snap to grid

Difference between revisions of "User:00zX"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Proposal - UScripting: - Made some adjustments, corrected some typos, updated links, yada yada)
m (Work)
 
(61 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
==Works in Progress==
+
==Wiki==
 +
====General====
 +
:[[User:00zX/Setting_Up_Your_UScript_Environment|Setting Up Your UScript Environment]]
 +
====UE3====
 +
:[[User:00zX/Using_The_Unreal_Engine_3_Preprocessor|Using The Unreal Engine 3 Preprocessor]]
 +
====UE2.5====
 +
:[[UE2:Using_the_UT2004_mod_system|Using The UT2004 Mod System]]
 +
====Rants====
 +
[[User:00zX/Rants|Rants]]
 +
 
 +
==Work==
 
====Unreal Development Kit====
 
====Unreal Development Kit====
:[[User:00zX/Project Silky_(UDK)|UDK: Project Silky]] - ''Status:'' '''Prototype'''
+
:[[User:00zX/Plugin_(UDK)|UDK: ReDeX]] ''Status:'' '''Testing'''  
:[[User:00zX/GameDex Framework_(UDK)|UDK: GameDex Framework]] - ''Status:'' '''Design'''
+
:''Description:'' PC Framework for UDK, its a combination of a framework and macros along with associated parser functionality.
 +
::''GamedGFx:''' Scaleform interface along with object saving/loading.
 +
::'''GamedEx:''' GPAK Game framework built using Redux, support for many features; round based play, archetype systems, additions to particles, materials, etc.
 +
::'''GamedCaster:''' First Person Multiplayer PvP.
 +
 
 +
:[[User:00zX/Project Silky_(UDK)|UDK: Project Silky]] ''Status:'' '''Alpha''' (on hold)
 
====Unreal Tournament 3====
 
====Unreal Tournament 3====
:[[User:00zX/GameDex Framework_(UT3)|UT3: GameDex Framework]] - ''Status:'' '''Beta'''
+
:[[User:00zX/GameDex Framework_(UT3)|UT3: GameDex Framework]] ''Status:'' '''Beta''' (on hold)
::[[User:00zX/GameDex_Framework_(UT3)#Newtators (Mutator pack)|Newtators-v1.9e]] - ''Status:'' '''Point Release'''
+
::[[User:00zX/GameDex_Framework_(UT3)#Newtators (Mutator pack)|Newtators-v1.9e]] ''Status:'' '''Point Release'''
::[[User:00zX/GameDex_Framework_(UT3)#Attrition (Gametype)|Attrition-v0.5pb]] - ''Status:'' '''Public Beta'''
+
::[[User:00zX/GameDex_Framework_(UT3)#Attrition (Gametype)|Attrition-v0.5pb]] ''Status:'' '''Public Beta'''
====Visual Studio Express C#====
+
====Unreal Tournament 2004====
:UScriptIt - Chasing the dragon through the meta
+
:[[User:00zX/UC2004_(UT2004)|UT2004: Unreal Championship 2004]] ''Status:'' '''Beta''' (dissolved)
 +
:[http://www.divshare.com/download/16967446-918|UT2004: Turbo Instagib] ''Status:'' '''Beta'''
 +
:[http://www.divshare.com/download/16967454-2c0|UT2004: CrapLink]] ''Status:'' '''Beta'''
 +
<br>
  
 
==Highlighters==
 
==Highlighters==
Line 15: Line 33:
 
===UnrealWiki - Code Noir Redex Theme===  
 
===UnrealWiki - Code Noir Redex Theme===  
 
[[File:Monobook-noir-alpha3.gif|700px|thumb|left]]
 
[[File:Monobook-noir-alpha3.gif|700px|thumb|left]]
====Status: Beta 1 (testing)====
+
====Status: Beta====
 
To Install copy the contents of the following page into your own ''''User:[name]/monobook.css'''' page.
 
To Install copy the contents of the following page into your own ''''User:[name]/monobook.css'''' page.
 
::[[User:00zX/monobook.css]]
 
::[[User:00zX/monobook.css]]
 
::[http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwiki.beyondunreal.com%2FUser%3A00zX%2Fmonobook.css&profile=css21&usermedium=all&warning=1&lang=en W3C CSS Validator]
 
::[http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwiki.beyondunreal.com%2FUser%3A00zX%2Fmonobook.css&profile=css21&usermedium=all&warning=1&lang=en W3C CSS Validator]
 +
::[http://i10.photobucket.com/albums/a123/OlympusMons/CodeNoirRedeX.png High Resolution Image]<br>
 
=====Features=====
 
=====Features=====
 
:Dark Theme
 
:Dark Theme
Line 30: Line 49:
 
:Profile settings page unreadable.
 
:Profile settings page unreadable.
 
<br><br><br>
 
<br><br><br>
 
==Proposal - Unreal Engine==
 
+[[Unreal_Engine|Unreal Engine]] | [[Legacy:Unreal_Engine|Unreal Engine]]
 
++[[Legacy:Terminology|Terminology]]
 
++[[Engine Directory Structure]] | [[Legacy:Engine_Directory_Structure|Directory Structure]]
 
++File Formats
 
+++[[UC_File|.UC]]
 
+++[[UPKG_File|.UPKG]]
 
+++[[Legacy:Localization|Localization]] (INT)
 
++[[UnrealScript|Unreal Script]] | [[Legacy:UnrealScript]]
 
+++[[Commandlet]] | [[Legacy:Commandlet]]
 
++++Compiling | [[Legacy:Compiling_With_UCC]]
 
+++++[[Compiler Error]] | [[Legacy:Compiler_Error|Compiler Error]]
 
 
==Proposal - Unreal Script Feature Recommendations==
 
===Block Scope variable definitions===
 
 
'''This:'''<uscript>
 
function NoBlockScope()
 
{
 
local Object Obj;
 
 
foreach ObjArray(Obj)
 
{
 
//do something here
 
}
 
}</uscript>
 
 
'''Would become:'''<uscript>
 
function BlockScope()
 
{
 
foreach ObjArray(local Object Obj)
 
{
 
//do something here
 
}
 
}</uscript>
 
'''The local keyword could be replaced with var, block or just omitted entirely. Similarly this would work for any type as in the following:'''<uscript>
 
function BlockScopeTwo()
 
{
 
foreach ObjArray(var Object Obj, var int i)
 
{
 
//do something here
 
//Obj and i are only accessible here
 
}
 
//Obj and i are not assigned in this scope
 
}</uscript>
 
 
===Default variable assignment===
 
'''This:'''<uscript>
 
function bool CheckReplacement(Actor Other)
 
{
 
local Controller C;
 
 
C = Controller(Other);
 
 
if(C != None)
 
{
 
//do something here
 
}
 
}</uscript>
 
'''Would become:'''<uscript>
 
function bool CheckReplacement(Actor Other)
 
{
 
local Controller C = Controller(Other);
 
 
if(C != None)
 
{
 
//do something here
 
}
 
}</uscript>
 
'''The following example is of both block scope and default variable assignment:'''
 
<uscript>
 
function BlockScopeThree()
 
{
 
for(local int i = 0; i < A.length; ++i)
 
{
 
//do something here
 
}
 
}</uscript>
 
 
<br>
 
<br>
  
==Proposal - UScripting==
+
==Contact Me==
Step by step process of installing, setting up jEdit for use with Uscript. From start to finish, using/committing to repository's and building using Apache Ant. A major portion of this tutorial is dedicated to giving you the knowledge to editing/customizing your programming environment to your liking (I do feel this can help to improve workflow).
+
====IRC====  
 
+
_00zX on [irc://irc.enterthegame.com EnterTheGame]
{{ambox|text=you can replace any of these with a program of your choosing, some of the [[Unreal_Wiki:Basic_procedures|basic procedure]] in this tutorial are generic enough that program doesnt matter. Some of these steps however are only directly relevant to the programs listed below.}}
+
Tools suggested for this tutorial:
+
*[[Legacy:JEdit|jEdit]] - Programmers text editor
+
*[[GIT]] - Source/Build Repository
+
*[[Legacy:UnCodeX|Uncodex]] - UScript Class Browser
+
*[[NSIS]] - Installer/Packaging
+
 
+
===Introduction to jEdit===
+
<div class="hidden-block"><span class="hint"></span><div class="hidden">
+
:[http://www.jedit.org/ jEdit] is a powerful, cross platform, java based programmers text editor.<br>
+
 
+
====Edit Modes====
+
:jEdit uses what is called edit modes, these specify:
+
::* Syntax highlighting rules
+
::* Auto indent behavior
+
::* Various other customizations for editing a certain filetype
+
 
+
:These edit modes are easily installed an updated, they use the XML language and jEdits own document type definition for modes (xmode.dtd). More information on edit modes can be found within jEdits Help section along with a section on writing edit modes so you can customize jEdits UScript mode to your liking.<br>
+
 
+
=====Setting jEdits Mode=====
+
::By default jEdit comes with a UScript mode which can be located in the {'''jEdit Home Directory'''}\Modes this edit mode is very light weight and doesnt cover all engine versions.<br>
+
::Im going to recommend not using this directory if you plan to modify your edit mode or use one of the custom ones provided below, the reason for this is simpler backups when using the document directory.<br>
+
 
+
::On jEdits main toolbar you will find the utilities button, under that is the global options which contains the options for all edit modes. Syntax highlighting colours can be found in here also.
+
 
+
::[[User:Wormbo/UScript_edit_mode|Wormbo's UScript jEdit Mode]]<br>
+
::[[User:00zX/UScript.xml|My modified UScript jEdit Mode]]<br>
+
 
+
====Recommended Plugins====
+
:* Project Viewer: Usability.
+
:* Buffer Tabs: Usability.
+
:* Dirty Gutter: Diff.
+
:* TaskList: TODO, NOTE, FIXME's
+
:* Text Autocomplete: Usability - Code Completion.
+
:* Ant Plugin: Build script for UDK with ant.
+
:* WhiteSpace: Usability/Readability.
+
 
+
:* Others: Code folding
+
 
+
=====Plugin Installation and Settings=====
+
::jEdits Plugin Manager and Settings can be accessed through the Plugins button on the main toolbar (show picture).<br>
+
 
+
::To install new plugins, click on the plugin manager and you will notice a tab up the top of the new window which says install (show picture).
+
Navigate to this and select the check-boxes for all plugins you wish to install then hit install in the lower left of the panel.
+
 
+
::The plugin settings can be found under the Plugins/Plugin Option button on jEdits main toolbar at the top.
+
 
+
{{ambox|type=notice|text=I'll guide you through the settings for each of the recommended plugins to show you which options I prefer as you may want to adjust these or similar to your liking.}}
+
<br>
+
====Creating your first Project====
+
:In this part of the tutorial we will be creating a project using jEdit and Project Viewer.
+
 
+
:First off I prefer to have the project viewer docked on the left hand side of jEdit, you can however put it anywhere you wish to place it.
+
Right click on All Projects which you should see in your project viewer, add a new group (this is a recommendation), this will help to keep all your UScript UT3/UDK etc separate from any other projects you may wish to create.
+
I have a group named '''UE3''' for example, then under that group I have '''UT3''' and '''UDK''' to house each of the projects I have for each.
+
 
+
:Once you have your groups setup to your liking you are ready to create a project, this will require that you have a directory to scan for source files within.
+
<br>
+
 
+
{{ambox|type=notice|text=Update these to contain info on various UE versions in the new namespace's, then use those [[Unreal_Wiki:Basic_procedures|Basic Procedures]] as part of this tutorial.
+
[[Legacy:Add_EditPackage]]}}<br>
+
 
+
=====Directory Structure and creating Package Folders=====
+
Firstly you'll need to have an understanding of [[Unreal Engine]]s '''[[Engine_Directory_Structure|directory structure]]''', from there you will be able to [[Create_Package_Folders|create the required folders for packages]] so you can [[compile]] the [[UC_File|*.UC files]] into a [[Package_File|package file]]. For Unreal Script [[Classes]] ([[UC_File|*.UC files]]) you will need to first make the [[Legacy:Package|package's]] folder and then the [[Classes]] folder. The following eg shows the package folders being:
+
 
+
::'''UT2004''' - All UT2004 source can be located under the {[[Base Directory]]}\System Directory so you would create a new directory containing the directory classes in there.<br>
+
::'''UT3''' - For UT3 you create a folder in the {[[User Documents Directory]]}\My Games\Unreal Tournament 3\UTGame\Src directory also containing the directory classes.<br>
+
::'''UDK''' - For UDK you create a folder in the {[[Base Directory]]}\Development\Src directory.<br>
+
 
+
So you should have a directory structure like:<br>
+
::'''UT2004''' - {[[Base Directory]]}\System\{'''Your Package'''}\Classes<br>
+
::'''UT3''' - {[[User Documents Directory]]}\My Games\Unreal Tournament 3\UTGame\Src\{'''Your Package'''}\Classes<br>
+
::'''UDK''' - {[[Base Directory]]}\Development\Src\{'''Your Package'''}\Classes<br>
+
 
+
Right click on the group you wish to create the project within, click '''Add Project'''. This will display the create project dialogs (show Picture)
+
Select a name and the root directory for you project, for now select {'''Your Package'''} directory. Or alternatively if you wish to use multiple [[package]]'s for your project you may add the {[[base source directory]]}, you will however need to filter the imported folders so that only the ones you require for your project are displayed.
+
 
+
Project Viewer would now have selected the project for you, you can navigate back to all projects using the drop down box at the top of Project Viewer.
+
<br>
+
====Creating your first Class====
+
Go to file in jEdits main toolbar and select new. Copy/Paste this template unreal script class to the file, then save the file as {'''Your Package'''}\Classes\YourClass.uc
+
<uscript>class YourClass extends Mutator;
+
 
+
function InitMutator(string Options, out string ErrorMessage)
+
{
+
`log("I am your mutator",,'mutator');
+
}
+
</uscript>
+
 
+
You'll notice that Project Viewer doesnt automatically scan for new classes unless it has been selected to do so. Right click on your project in the Project Viewer panel and select 'Re-import files'.
+
Make sure the Project and Classes directories are expanded and you should now see {'''Your Class'''} in there.
+
 
+
=====More on jEdit Modes=====
+
Creating a customized template an macro for creating a new class based on this template.
+
 
+
=====Customizing Project Viewer=====
+
Specialized section on setting up Project Viewer's context (Right Click) menu to contain a create class button which will create a class based on a UScript template.
+
 
+
You may skip to [[User:00zX#Compiling|Compiling]] at this point.
+
</div></div>
+
===Introduction to UnCodex===
+
<div class="hidden-block"><span class="hint"></span><div class="hidden">
+
This is basically a must have application for anyone doing UScript unless ofcoarse you opt to use other IDE's which contain their own class browsers.
+
Personally I think [[UnCodeX|UnCodeX]] is still the best out there and its quick with minimal overhead.
+
 
+
There are two versions of [[UnCodeX|UnCodeX]] that I use, I prefer using the older 227 for anything pre-UE3 or TribesV for those I use the newer 237-beta version.
+
 
+
{{ambox|type=notice|text=Ideally jEdit would allow UScript class browsing like it does Java. There was an Eclipse plugin, theres a Visual Studio IDE called [Nfringe] and there is also (Gah I forget the name).}}
+
<br>
+
====Setting Up UnCodex====
+
Working with multiple copies of unreal engine source (for example, numerous [[UDK]] copies) can be tedious to continuously analyze all the time in [[legacy:uncodex|UnCodex]] so I'll guide you through setting it up so you can have numerous shortcuts all which cache different versions of [[Unreal Engine]].
+
You have to be careful however, this can get confusing as to which copy is in which [[UnCodeX|UnCodeX]] window but you can double check the title bar, which I highly recommend you do. I have been caught out a few times with this myself between UT3 and UDK sources.<br>
+
 
+
As a general rule of thumb I just use the naming convention:<br>
+
"Drive:\{UnCodeX}\UnCodeX.exe" -config UnCodeX-{GameName/Version}.ini<br>
+
 
+
::'''UT2004''' - "Drive:\{UnCodeX227}\UnCodeX.exe" -config UnCodeX-UT2004.ini<br>
+
::'''DeusEx''' - "Drive:\{UnCodeX227}\UnCodeX.exe" -config UnCodeX-DeusEx.ini<br>
+
::'''UT3''' - "Drive:\{UnCodeX237-beta}\UnCodeX.exe" -config UnCodeX-UT3.ini<br>
+
::'''UDK''' - "Drive:\{UnCodeX237-beta}\UnCodeX.exe" -config UnCodeX-UDK-2009-11-2.ini<br>
+
::'''UDK''' - "Drive:\{UnCodeX237-beta}\UnCodeX.exe" -config UnCodeX-UDK-2010-03.ini<br>
+
 
+
Now these [[INI_File|INI]]'s will have to exist for this to work, so copy the default ''UnCodeX.ini'' and rename it to ''UnCodeX-{GameName/Version}.ini''.
+
Open this file in jEdit or notepad for editing,
+
 
+
<pre>
+
[Sources]
+
''Add your source directories here''
+
</pre>
+
::'''UT2004''' - {[[Base Directory]]}\System\<br>
+
::'''UT3''' - {[[User Documents Directory]]}\My Games\Unreal Tournament 3\UTGame\Src\<br>
+
 
+
{{ambox|type=notice|text=This can be done once [[UnCodeX|UnCodeX]] is loaded for this mode.}}<br>
+
 
+
{{ambox|type=notice|text=For UT3 you will require two directories selected for scanning, one is the exported script directory the other is Src directory within UTGame.
+
With UT2.x and UDK you work along side Epic's Packages so it'll scan both, you can set [[UnCodeX|UnCodeX]] to scan numerous directories for any mode.}}<br>
+
 
+
{{ambox|type=warning|text=This is an absolute requirement for [[UnCodeX|UnCodeX]] to function in multiple mode's correctly. In the past I have forgotten to do this and as the cache is not saved for that source directory you must rescan each time [[UnCodeX|UnCodeX]] is loaded.}}
+
<pre>
+
[GUI.General]
+
StateFile=UnCodeX-{GameName-Version}.ucx
+
</pre>
+
 
+
::'''UT2004''' - StateFile=UnCodeX-UT2004.ucx<br>
+
::'''DeusEx''' - StateFile=UnCodeX-DeusEx.ucx<br>
+
::'''UT3''' - StateFile=UnCodeX-UT3.ucx<br>
+
::'''UDK''' - StateFile=UnCodeX-UDK-2009-11-2.ucx<br>
+
::'''UDK''' - StateFile=UnCodeX-UDK-2010-03.ucx<br>
+
 
+
Once you have done that for your required modes you can boot the shortcut and analyze the source, now every time you boot you would be using the cache for that ini/source.
+
</div></div>
+
 
+
===Introduction to Git===
+
<div class="hidden-block"><span class="hint"></span><div class="hidden">
+
Git is a free & open source, distributed version control system.
+
[http://git-scm.com/ GIT]<br>
+
[http://code.google.com/p/msysgit/ msysgit - windows]<br>
+
====GIT command prompt====
+
=====Creating a repository======
+
<syntaxhighlight lang="bash">
+
# cd hello
+
# ls
+
# git init
+
# git add .
+
</syntaxhighlight>
+
=====Pushing a repository to GitHub=====
+
Create a repository on GitHub then...
+
<syntaxhighlight lang="bash">
+
# cd hello
+
# git remote add origin git@github.com:tabrez/hello.git
+
# git push origin master
+
</syntaxhighlight>
+
<br>
+
====GIT GUI====
+
=====Pushing a repository to GitHub=====
+
</div></div>
+
===Compiling===
+
<div class="hidden-block"><span class="hint"></span><div class="hidden">
+
====Using Batch (Windows)====
+
''UDK'' - Simple Compile batch
+
<syntaxhighlight lang="dos">
+
Drive:\UDK\{UDK-Version}\Binaries\UDK.exe make -debug -intermediate -log=CompileLog.log -full
+
pause
+
</syntaxhighlight>
+
<br>
+
 
+
''UT3'' - Multi-Package Compile batch
+
<syntaxhighlight lang="dos">
+
@echo Off
+
prompt $g
+
rem BASE DIRECTORIES
+
set UTDIR="D:\Midway\Unreal Tournament 3"
+
set UTCOM=%UTDIR%\Binaries\UT3.COM
+
 
+
rem PROJECT DETAILS
+
set UP1=UT_
+
set UP2=UT_GDP_
+
set K1=MDB
+
set K2=GameDex
+
set K3=Newtators
+
set K4=Mutatoes
+
 
+
rem script
+
set UTCONFIG=..\Config
+
set UTCOMSRC=..\Unpublished\CookedPC\Script
+
set MYCOMSRC=..\Unpublished\CookedPC\GameDex
+
 
+
@echo On
+
del %MYCOMSRC%\%UP1%%K1%.u
+
del %MYCOMSRC%\%UP1%%K2%.u
+
del %MYCOMSRC%\%K3%\%UP2%%K3%.u
+
rem del %MYCOMSRC%\%K4%\%UP2%%K4%.u
+
 
+
%UTCOM% make -debug -useunpublished -log=CompileLog.log -full
+
copy %UTCOMSRC%\%UP1%%K1%.u %MYCOMSRC%\%UP1%%K1%.u
+
copy %UTCOMSRC%\%UP1%%K2%.u %MYCOMSRC%\%UP1%%K2%.u
+
copy %UTCOMSRC%\%UP2%%K3%.u %MYCOMSRC%\%K3%\%UP2%%K3%.u
+
copy %UTCOMSRC%\%UP2%%K4%.u %MYCOMSRC%\%K4%\%UP2%%K4%.u
+
del %UTCOMSRC%\%UP1%%K1%.u
+
del %UTCOMSRC%\%UP1%%K2%.u
+
del %UTCOMSRC%\%UP2%%K3%.u
+
del %UTCOMSRC%\%UP2%%K4%.u
+
 
+
del %UTCONFIG%\%UP1%%K2%.ini
+
del %UTCONFIG%\%UP2%%K3%.ini
+
rem del %UTCONFIG%\%UP2%%K4%.ini
+
 
+
pause
+
prompt $p$g
+
</syntaxhighlight>
+
</div></div>
+
===Introduction to NSIS===
+
<div class="hidden-block"><span class="hint"></span><div class="hidden">
+
[http://nsis.sourceforge.net/Main_Page NSIS]
+
 
+
<syntaxhighlight lang="nsis">
+
;
+
; GameDex-Std.nsi
+
; Creation Date:
+
; Last Updated: 22/04/2010 03:32
+
; Contributors: 00zX
+
; Attribution-Noncommercial-Share Alike 3.0 Unported
+
; http://creativecommons.org/licenses/by-nc-sa/3.0/
+
;
+
;--------------------------------
+
!define PRODUCT_MODE_STANDARD
+
 
+
!include "GameDex.nsh"
+
 
+
Function .onInit
+
ReadRegStr $INSTDIR HKLM ${REG_UT} "InstallLocation"
+
StrCmp $INSTDIR "" 0 NoAbort
+
MessageBox MB_OK "Unreal Tournament 3 not found, Install Aborted!"
+
Abort ; causes installer to quit.
+
NoAbort:
+
FunctionEnd
+
 
+
;TODO: Detect GameDex version
+
!insertmacro GAMEDEX_PAK
+
 
+
!insertmacro redef GAMEDEX_PAK_NAME "Newtators"
+
!insertmacro GAMEDEX_PAK_SEC
+
 
+
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+
!insertmacro MUI_DESCRIPTION_TEXT ${GameDex} "Main GameDex Packages"
+
!insertmacro MUI_DESCRIPTION_TEXT ${Newtators} "Addon Package for GameDex"
+
!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
 
+
!define GAMEDEX_UNPAK
+
!insertmacro GAMEDEX_PAK
+
 
+
!insertmacro redef GAMEDEX_PAK_NAME "Newtators"
+
!insertmacro GAMEDEX_PAK_SEC
+
 
+
Section Uninstall
+
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
+
SetAutoClose false
+
SectionEnd
+
</syntaxhighlight>
+
 
+
====Creating an NSIS package script====
+
</div></div>
+
===Introduction to Ant===
+
Using Ant to package a release.
+
[http://ant.apache.org/manual/index.html|Ant Online Manual]
+
 
+
=====Ideas=====
+
Using Ant scripts to commit to git repository.
+
 
+
==Proposal - Replication==
+
 
+
===Replication===
+
====Status: On Hold====
+
--[[User:00zX|00zX]] 13:23, 22 April 2010 (UTC)<br>
+
:[[Replication]] / [[Replication_(computer_science)]]
+
:Concept of servers and clients.(NetMode/Role/Relevance/Reliability)
+
*{{classgames|ENetMode}} (concept)
+
*[[Replication_block|Replication Block]]
+
**Variable Value Replication
+
***[[Repnotify]] / [[UE3:Actor_events_(UT3)#ReplicatedEvent|ReplicatedEvent]]
+
**Using Predefined Variables - '''bNetInitial'''
+
**Actor Replication
+
***Relevance
+
***Role and RemoteRole
+
***Useful Properties
+
*Function Replication
+
**Server/Client/Simulated/Replicated
+
**Reliability - [[Functions#Network_modifiers|Network modifiers]]
+
*[[UE3:ReplicationInfo_(UT3)|ReplicationInfo]]
+
**[[UE3:GameReplicationInfo_(UT3)|GameReplicationInfo]] (GRI)
+
**[[UE3:PlayerReplicationInfo_(UT3)|PlayerReplicationInfo]] (PRI)
+
**[[UE3:UTLinkedReplicationInfo_(UT3)|LinkedReplicationInfo]] (LRI)
+
 
+
<div class="hidden-block"><span class="hint"></span><div class="hidden">
+
===NetMode===
+
:The [[UE3:WorldInfo_(UT3)|WorldInfo]] (previously [[LevelInfo]] for most Unreal Engine games pre UT3/GOW) defines the {{classgames|ENetMode}} enumeration.
+
 
+
<uscript>
+
if(WorldInfo.NetMode != NM_DedicatedServer)
+
// Code here will only be executed on Listen servers and game clients.
+
+
if(WorldInfo.NetMode == NM_DedicatedServer)
+
// Code here will only be executed on a server.
+
 
+
if (WorldInfo.NetMode < NM_DedicatedServer)
+
// Code here will only be executed on Listen servers and game clients.
+
 
+
if (WorldInfo.NetMode > NM_DedicatedServer)
+
// Code here will only be executed on a server or standalone client.
+
</uscript>
+
 
+
===Replication Block===
+
====Variable Value Replication====
+
<uscript>
+
var() float NewEquipTime;
+
var() float NewPutDownTime;
+
 
+
replication
+
{
+
if(bNetDirty && (Role == ROLE_Authority) && bNetInitial)
+
NewEquipTime, NewPutDownTime;
+
}
+
</uscript>
+
<br>
+
=====Repnotify and Replicated Events=====
+
This is new in Unreal Engine 3 and is not available in previous versions.
+
<uscript>
+
simulated event ReplicatedEvent(name VarName); // Called when a variable with the property flag "RepNotify" is replicated
+
 
+
/** adds/removes a property from a list of properties that will always be replicated when this Actor is bNetInitial, even if the code thinks
+
* the client has the same value the server already does
+
* This is a workaround to the problem where an LD places an Actor in the level, changes a replicated variable away from the defaults,
+
* then at runtime the variable is changed back to the default but it doesn't replicate because initial replication is based on class defaults
+
* Only has an effect when called on bStatic or bNoDelete Actors
+
* Only properties already in the owning class's replication block may be specified
+
* @param PropToReplicate the property to add or remove to the list
+
* @param bAdd true to add the property, false to remove the property
+
*/
+
native final function SetForcedInitialReplicatedProperty(Property PropToReplicate, bool bAdd);
+
</uscript>
+
'''Usage:'''[[UE3:DroppedPickup_(UT3)]]
+
<br>
+
 
+
====Using Predefined Variables====
+
<uscript>
+
replication
+
{
+
// Physics
+
if( (!bSkipActorPropertyReplication || bNetInitial) && bReplicateMovement
+
&& ((RemoteRole == ROLE_SimulatedProxy) && (bNetInitial || bUpdateSimulatedPosition)) )
+
}
+
</uscript>
+
===Actor Replication===
+
====Relevance====
+
====Role and RemoteRole====
+
:The [[Actor]] class defines the {{classgames|ENetRole}} enumeration and two variables, '''Role''' and '''RemoteRole''', as follows:
+
 
+
<uscript>
+
if (Role == ROLE_Authority)
+
{
+
// This is the authorative copy of this actor, it was spawned on this machine.
+
// It is not a guarantee that we are on the server or in single player!
+
}
+
 
+
if (Role < ROLE_Authortity)
+
{
+
// This is a non-authorative copy of this actor that was replicated
+
// from the server. In other words, we must be on a client.
+
}</uscript>
+
<br>
+
As in the replication block of Actor.uc UT3
+
 
+
====Useful Replication Properties====
+
;[[const]] [[bool]] bNetTemporary : Tear-off simulation in network play.<br>
+
;[[const]] [[bool]] bOnlyRelevantToOwner : this actor is only relevant to its owner. If this flag is changed during play, all non-owner channels would need to be explicitly closed.<br>
+
;var transient [[bool]] bNetDirty : set when any attribute is assigned a value in unrealscript, reset when the actor is replicated
+
;var [[bool]] bAlwaysRelevant : Always relevant for network.
+
;var [[bool]] bReplicateInstigator : Replicate instigator to client (used by bNetTemporary projectiles).
+
;var [[bool]] bReplicateMovement : if true, replicate movement/location related properties
+
;var [[bool]] bSkipActorPropertyReplication : if true, dont replicate actor class variables for this actor
+
;var [[bool]] bUpdateSimulatedPosition : if true, update velocity/location after initialization for simulated proxies
+
;var [[bool]] bTearOff : if true, this actor is no longer replicated to new clients, and is "torn off" (becomes a ROLE_Authority) on clients to which it was being replicated.
+
;var [[bool]] bOnlyDirtyReplication : if true, only replicate actor if bNetDirty is true - useful if no C++ changed attributes (such as physics) bOnlyDirtyReplication only used with bAlwaysRelevant actors
+
;var [[const]]  [[bool]]  bNetInitialRotation : Should replicate initial rotation.  This property should never be changed during execution, as the client and server rely on the default value of this property always being the same.
+
;var [[bool]] bNeverReplicateRotation : If true, never replicate rotation
+
;var [[bool]] bReplicateRigidBodyLocation : replicate Location property even when in PHYS_RigidBody
+
;var [[bool]] bKillDuringLevelTransition : If set, actor and its components are marked as pending kill during seamless map transitions
+
;var [[const]] [[bool]] bExchangedRoles : whether we already exchanged Role/RemoteRole on the client, as removing then readding a streaming level causes all initialization to be performed again even though the actor may not have actually been reloaded
+
 
+
=====booleans=====
+
* <code>(Level.NetMode == NM_Client && bNetOwner)</code> &ndash; owner clients (special case of client where the local player is the Owner of the actor in question)
+
 
+
'''UT2004'''
+
 
+
NetUpdateFrequency is another variable useful in replication. It effectively causes an otherwise relevant (not useful when the actor is not relevant) actor to be relevant NetUpdateFrequency times per second. This is useful when the data changes frequently but you only want periodic updates. For example, PlayerReplicationInfo contains a lot of data about the client. Stuff like the various player's pings may change quite frequently, and having the client keep track of such information would be quite a network hog. But since PlayerReplicationInfo has a NetUpdateFrequency of 2, it is only updated twice a second, which is much nicer for that player's bandwidth. The list of the current NetUpdateFrequency's for all UT classes are listed below:
+
 
+
Actor - 100 Hz (times per second)<br>
+
ZoneInfo - 4 Hz<br>
+
GameReplicationInfo - 4 Hz<br>
+
PlayerReplicationInfo - 2 Hz<br>
+
Inventory - 8 Hz<br>
+
 
+
===Function replication===
+
: Like replicated variables, the replication of a function call can be tied to certain conditions. In Unreal Engine 1 and 2 this condition is specified via the replication block and typically involves comparing the actor's Role to the value ROLE_Authority, Unreal Engine 3 provides the special function modifiers client and server instead.
+
 
+
====Client====
+
<uscript>
+
/** Sets the clients weapon to use the replicated variables */
+
reliable client function SetWeapProps(UTWeapon W)
+
{
+
W.EquipTime = NewEquipTime;
+
W.PutDownTime = NewPutDownTime;
+
}</uscript>
+
 
+
====Server====
+
<uscript>
+
/** Gets the times from the weapons and sets them to the replicated variables */
+
reliable server function GetWeapProps(UTWeapon W)
+
{
+
NewEquipTime = W.default.EquipTime * 0.68;
+
NewPutDownTime = W.default.PutDownTime * 0.70;
+
}</uscript>
+
 
+
</div></div>
+
<br>
+
 
+
==Wiki==
+
===Contact Me===
+
======IRC======  
+
00zX on [irc://irc.enterthegame.com EnterTheGame]
+
 
;* [irc://irc.enterthegame.com/unrealscript #unrealscript on EnterTheGame]
 
;* [irc://irc.enterthegame.com/unrealscript #unrealscript on EnterTheGame]
 +
;* [irc://irc.enterthegame.com/beyondunreal #beyondunreal on EnterTheGame]
 +
_00zX on [irc://irc.gamesurge.net GameSurge]
 +
;* [irc://irc.irc.gamesurge.net/udkc #udkc on GameSurge]
  
======Other/Profiles======
+
====Other/Profiles====
 
[[Special:Emailuser/00zX|E-mail 00zX]] or on
 
[[Special:Emailuser/00zX|E-mail 00zX]] or on
;* [http://www.filefront.com/user/00zX filefront]
+
;* MonsOlympus @ [www.pastebin.org]
;* [http://delicious.com/00zX delicious]
+
  
 
--------<br>
 
--------<br>

Latest revision as of 08:15, 8 December 2012

Wiki

General

Setting Up Your UScript Environment

UE3

Using The Unreal Engine 3 Preprocessor

UE2.5

Using The UT2004 Mod System

Rants

Rants

Work

Unreal Development Kit

UDK: ReDeX Status: Testing
Description: PC Framework for UDK, its a combination of a framework and macros along with associated parser functionality.
GamedGFx:' Scaleform interface along with object saving/loading.
GamedEx: GPAK Game framework built using Redux, support for many features; round based play, archetype systems, additions to particles, materials, etc.
GamedCaster: First Person Multiplayer PvP.
UDK: Project Silky Status: Alpha (on hold)

Unreal Tournament 3

UT3: GameDex Framework Status: Beta (on hold)
Newtators-v1.9e Status: Point Release
Attrition-v0.5pb Status: Public Beta

Unreal Tournament 2004

UT2004: Unreal Championship 2004 Status: Beta (dissolved)
Turbo Instagib Status: Beta
CrapLink] Status: Beta


Highlighters

UnrealWiki - Code Noir Redex Theme

Monobook-noir-alpha3.gif

Status: Beta

To Install copy the contents of the following page into your own 'User:[name]/monobook.css' page.

User:00zX/monobook.css
W3C CSS Validator
High Resolution Image
Features
Dark Theme
High Contrast
Improved Readability
Highlighter adjustments for UScript, CSS and XML
Different coloured borders per GameNameSpace
Curved Borders in supporting browsers
Known Issues
Edit/Input boxes are still black text on white.
Profile settings page unreadable.





Contact Me

IRC

_00zX on EnterTheGame

_00zX on GameSurge

Other/Profiles

E-mail 00zX or on

  • MonsOlympus @ [www.pastebin.org]