[hemmerling] CORE ( COREGAMES ) 2/2 - CORE Application Development

Help & Documentation

Overview

Help Center / Support

Documentation

Lua & Lua Tutorials

Lua

Lua Tutorials of CoreGames Documentation

Standard Lua 5.3 versus CORE Lua 5.3

Missing with CORE Lua 5.3

  • arg.
  • debug library.
  • dofile().
  • loadfile().
  • io library.
  • package library, e.g. package.path, package.preload[“foo”], package.loadlib()...
  • Part of the os library ( os.execute(), os.exit(), os.remove(), ... ).

Modified with CORE Lua 5.3

  • collectgarbage (modified to only accept a count parameter to get current Lua memory usage).
  • getmetatable (modified).
  • print (modified so it goes to Unreal logs and the Event log).
  • rawget (modified).
  • rawset (modified).
  • require (modified).
  • setmetatable (modified).
  • _G (modified so it is separate from _ENV).
    • _G - This is a global table that can be accessed from any script, but there is a separate version of the table for each machine (one for the server + one for each client). Values set on one client’s _G table can’t be read by any other clients or the server, and values set on the server version of _G cannot be read by any clients”.
    • The server and client _G tables are empty. You may copy the list of global functions, tables from _ENV by a for loop.
function FunctionName()
end
TableName = {}
VariableName = "123"
_G["FunctionName"] = FunctionName -- Necessary for Lua@Core
_G["TableName"] = TableName -- Necessary for Lua@Core
_G["VariableName"] = VariableName -- Necessary for Lua@Core
print(_G["FunctionName"]) -- "function: 0000021CC1CB9520"
print(_G["TableName"]) -- "table: 0000021C925E5540"
print(_G["VariableName"]) -- "123".

Different with CORE Lua 5.3

  • Lua@CORE does not pass the typical Unix-style first line of a ( Lua ) script file :-(:
    1. ”#!/usr/bin/lua”
    2. #!/usr/​bin/env lua”
  • _ENV.
    print(_ENV == _G) -- prints true on Standard Lua, since the default _ENV is set to the global table
    print(_ENV == _G) -- prints false on Lua@CORE, since _G is modified so it is separate from _ENV.
    

Extra with CORE Lua 5.3

  • context Property.

Resources

Videos

Videos

Resources

My suggested Learning Path

Suggestions

  • Play some games suggested by the system. Extra goal: Reach Level 50 for 2 players √.
  • Each account / profile may have up to 250 CORE friends.
    • You may just chat with CORE friends ( online and offline ).
    • So how about making justs CORE profiles your friend, who already have published a CORE application? So you might contact and ask 250 CORE developers, per profile.
    • If you have 2 Window10 computers with CORE compatible graphics card, how about having 2 CORE acccounts, each Level 50, each up to 250 different CORE developers as CORE friends?!
    • Thats why my CORE profile text is “Founder and maintainer of the popular Lua UnitTest framework for CORE ( hemmerling_luaunit ). Graduated engineer - Dipl.-Ing.(FH) in Information Technology. German + English speaking. Learning Core Game Development. I am interested in exchange of experiences, communications & feedback by other CORE programmers & artists, any level from newbie like me to expert. Please accept my CORE friendship request :-)”.

Suggested Tutorials

  1. Course Core Academy - Course "Intro to Lua", Part I + II √.
  2. Video tutorial YouTube, JasonCdesign "Lua Basics Tutorial Series - Create a collectathon game" √ - “Using the Lua language in the Core games editor”.
  3. Course Core Academy - Course "Intro to Lua", Part III “Events and Game Loops” √.
    • “Basic Pistol(networked)” ⇒ “Parenting to client context. Some objects cannot be inside a client context. Shoot. Reload” :-(.
    • Instructions:
      1. “Basic Pistol(networked)” ⇒ “Deinstance this Object”.
      2. “Client Art (networked)” ⇒ “Create Network Context > New Client Context Containing This”.
        • “Wrapped networked object in client context. Client-only objects can´t be networked. Continue wrapping objects in client contect adn disable network for selected objects?”.
      3. “ClientContext (networked)” ⇒ “Game Collision = Force Off” ( this is the default setting ).
      4. You may also notice that the weapon, when equipped, could be not at all in the right spot. The animations should be correct, but the weapon position might be through your body or above your head, or rotated all weird” - Not true in 2020-04, anymore :-).
      5. *”Basic Pistol(networked)” ⇒ “Properties / Equipment / Socket = right_prop” ( this is the default setting ).
      6. “CoreContent / Utility” ⇒ “Weapon Guide 1handpistol” ⇒ “Basic Pistol(networked)”.
      7. “With the Weapon Guide 2hand_rifle 1handpistol selected, Set all Position Transforms in the Properties window to 0”.
    • The rest of the original instructions is easy to understand :-), though not all works as expected :-(.
    • Having a projectile also means that you can change how fast it travels through the air, along with other settings in the Weapon section” - No. Instead “Basic Pistol(networked) / Projectile / Projectile Speed = 25000” ( default value = 25000 , reset value = 20000 ).
    • “Universal Object Spawner” ⇒ Core Documentation, Reference "Core for Global Game Jams" - “Universal Object Spawner by standardcombo will allow you to continually spawn copies of objects, so players never run out of a resource, equipment, or weapon”
    • “FireFly”.
      • Press SHIFT to fly, and then WASDF to fly into a direction.
      • Parameter choice suggestions:
        • Select as model “Baseball Bat”, to be hold in the Client Context folder within the weapon.
        • Execute section, change Duration to 10 ( instead of 3 ).
        • In the Cooldown section, change the Duration to 1 ( instead of 12 ).
    • “Right Click to Aim”.
      • Press Mouse-Rightclick to activate the aim & zoom function.
    • “Ammo as a Pickup”.
      • “Pick up an ember pickup. Once you've gathered one, press R on the keyboard to trigger the reload ability”.
  4. Tutorial Core Documentation - Reference "Modeling Basics" √ - “Learning modelling basics in Core by making delicious food”.
    • Your Text Box probably came with another UI Container, but as this is already a child of a UI Container, we don't need both. Drag the CoinUI one level higher to just be a child of the Client Context folder. Then you can delete the extra UI Container”.
      • “Client context” vs “networked”:
        • In just “simple preview” mode, the IDE is running both the server and the client on the same machine.
        • “Client context” - Use it for visuals and user interface ( UI )!
        • If it matters, that each client is to see the exact same thing happening, then use “networked” context.
        • “Server context” - Visible just in “simple preview mode”, else invisible. The position of the object might be used as marker ( by the game developer ): In a script, it's position might be used to spawn a new object there.
        • If you enable networking for a “Static content” unit of objects, all objects of the unit together are considered to be one object.
          • With the benefit that this unit happens the same for every client.
          • There is less network communications, as there is just one network object, not a bunch of network objects.
          • But you can move around just the networked “Static contents” as unit, not the single objects of the unit, as a unit is not a group.
      • “But then, we have a lot of these other UI elements. And if we keep adding these, it's getting pretty unorganized. And so, traditionally in CORE, if we are using 3D objects, we would just go ahead up and group things up, or use folders depending on what our goal were”.
      • “But if we do this with UI, so as example I take these 2 background images, and I make them a group, you will notice that they get messed up” ( The “Position”, “Rotation” and “Scale” settings of groups and folders don´t apply to UI elements ! ). “And that is one of the reasons you want to avoid using groups inside the actual structure of the UI”.
      • So instead, what we can do, we actually create another panel, and we would make it a child of the parent panel there, and we would inherent size” ( width, height ) “from the parent. Then we can move all the stuff we want underneath that panel. That allows up to do some cleanup”.
    • YouTube, GamerTitan "Core Games UI Tutorial - Making A UI Toggle From A Keypress" - The template “GamerTitan Toggle UI Tutorial” is available as Community Content.
    • YouTube, GamerTitan "Core Games UI Button Tutorial - Making Clickable Buttons" ( “How To: Create Clickable UI Buttons in Core” ).
      • The template “GamerTitan UI Button Tutorial” is available as Community Content.
      • 10:00 “You can attach as much information as you want to each object in CORE. And on the client we use 'clientuserdata', and then it's a table attached to the object ... and this is valuable, for when you have multiple buttons for multiple things attached to a single event listener” = > Gives practical example of use of “clientuserdata” :-), but which is not in the final downloadable project :-(.
      • 13:00 “And locally, a client can send 10 events / second to the server”.
      • Project code makes use of “serveruserdata”.
      • Project code defines a UIPanel of several UIButtons as a CustomProperty and uses “clientuserdata” to differ between the UIButtons :-), but which is not in the final downloadable project :-(.
    • Buy menu.
        • “Tooltips” for CustomProperties :-), set in “WeaponBuyMenu.pbt”
                    Overrides {
                      Name: "cs:Enabled:tooltip"
                      String: "To disable the entire system set this to false (unchecked)"
          
        • Unfortunately, just the menu options are explained :-(. It does not explain how to build a menu or a framework, nor now to use the given framework :-(.
      • CORE Community Content Template “Weapon Buy Menu System” by CORE Games "Morticai" ( formerly: “Weapon Buy Menu” ).
        • Instructions if you want to import into an “Empty Project”:
          1. Import the video from “Community Content”.
          2. Drag the item “aponBuyM” from “Core Content” to your Hierarchy browser.
          3. After that, it is listed at “Imported Content”.
        • If you import to the gameplay framework “Team Deathmatch”, imported contents is immediately available at “My Templates”. After you dragged it to your Hierarchy browser, it is also available at “Imported Content”.
        • The video is outdated in 2021-05. At the earlier time of video making, imported contents was immediately available at “My Shared Content”.
  5. Global variables √.
  6. Wait / Sleep / Daemon ( Background Process ) √.
  7. “require()”, “context”, “_G.” √.
  8. UI.
  9. Queued applications, interconnected Games √.
    • CORE Documentation "CORE API - Player" √ - “TransferToGame”.
    • Error messages:
      • “Unable to transfer players outside of online mode!” - Interconnecting does not work in simulator, ok.
      • “There is a system cooldown for portaling between games. Please try again shortly” :-(. From my experience, a delay of 7 seconds is sufficient, 5 seconds might be too short.
        function OnBeginOverlap(trigger, other)
        	if other:IsA("Player") and not trigger.isInteractable then
        		Task.Wait(7)
        		other:TransferToGame(DESTINATION_GAME)
        	end
        end
  10. Events, Networking & Network communications ( also to and from UI ).
  11. Persistance.

My Contributions & my Questions

OpenSource CORE Projects and OpenSource CORE Templates

OpenSource CORE Templates

OpenSource CORE Community Projects

OpenSource Repositories with CORE Community Projects

My OpenSource CORE Projects and OpenSource CORE Templates

My OpenSource CORE Templates

My OpenSource CORE Projects

My special minimal CORE Projects, just generated to get Help by the Community

CORE Game Design Rules

  • Always have a single player mode, to avoid frustration of CORE players willing to test your CORE application!
    • Don´t tell already-in-game players “Waiting for 1 more players to start” :-(. Especially, think about if it's really great to lock up single players in a “Lobby”.
    • Don´t create CORE applications where you need to “Join Queue”.
    • Such a statement “Bridge is a bidding card game played with four players” is frustrating for CORE players :-(.
    • Instead, use AI to provide the missing CORE players. It's ok to warn the CORE player that other human CORE players are missing.
  • Avoid dependencies.
    • Fore CORE, modules which consist of single large LUA scripts are better than modules, which consist of and depend on several LUA scripts.
      • So avoid dependancies caused by the standard LUA “require()” import process, especially as with CORE, the LUA@CORE implementation of “require()” works differently:
        • You must add manually a reference to the required LUA script, as “Custom Propery”, by any script which requires it, additionally! It's not even documented in your LUA script ( which you might put to a code repository like GitHub )!
        • If you just have single-level requires, i.e. required files itself don´t contain require() statements:
          • Don´t put the required LUA scripts in the project tree! Just keep it at “Project Content / My Scripts”.
        • If you just have multi-level requires, i.e. required files itself contain require() statements:
          • The required LUA scripts must be located in the project tree, even though it's not intented that the are processed as if they are single executable scripts! So take care with the code, as it is processed at start of application, and not just after it is required!
    • See System Design ⇒ “Dependency inversion principle” ( “Dependency Injection”, “Inversion of Control”, “Hollywood principle - Don't call us, we'll call you” ).

Tips & Tricks

  • You can´t import your own resources ( graphics, sound,..) :-(.
  • You can´t unpublish once-published CORE applications, but you can re-publish a CORE application to be “unlisted” :-).
  • “You cannot invite more friends because you are at the limit of 256” :-( - You may have just 256 friends :-(.
  • Screenshot:
    • Pressing the keys ALT + PRINTSCREEN doesn´t provide a copy of the played game, in the Windows clipboard.
    • Use the “Xbox Game Bar” instead.
      • Configuration: Press the keys WINDOW + G, to activate “Xbox Game Bar”. Select the menu option “Capture” to open the capture pane.
      • Press the keys WINDOWS + ALT + PRINTSCREEN” to take a screenshot. Alternatively, you might press the button “Take Screenshot WINDOWS + Alt + Prtscrn” of the “Xbox Game Bar”.
      • Finally click on “Share all captures”. Select the wanted screenshot, and press “Copy to clipboard”.
    • Screenshot during the publication process:
      • You may take screenshots of the current viewport ( the graphical game preview in the IDE ), by “Publish Game” / “Take Screenshot”. Image size is 1280×720.
      • The screenshots are stored in the directory “C:\Users\<user>\Documents\My Games\CORE\Saved\Maps\<project_name>\Screenshots”, with ”<user>” = the name of the Windows user, and ”<project_name>” = the name of the CORE project created by the developer with the CORE IDE. The name of the screenshot files is like “Screenshot0001.png”, “Screenshot0002.png,... Before taking a screenshot, you may walk around in the viewport by the usual IDE commands, i.e. pressing keys while keeping mouse-rightclick pressed.
  • IDE.
    • V = “Gizmo visibility turned on”. You can now see the camera, spawn points, and trigger boxes.
    • While keeping mouse-rightclick pressed, pressing any of the keys to change the viewpoint ( Cartesian coordinate system ):
      • W - Forward.
      • S - Backward.
      • A - Right.
      • D - Left.
      • Q - Down.
      • E - Up.
      • F - Move to the selected item.
      • Mouse movement - Move the view into the direction where you tear the mouse ( Polar coordinate system ).
    • Mouse-rightclick offers a menu of view options:
      • Look at Object from Top.
      • Look at Object from Front.
      • Look at Object from Rear.
      • Move Camera to the Selected Object.
      • Move Selected Object to Camera, Position Only.
      • Move Selected Object to Camera and Align Orientation.
      • Mirror Selected Object in X.
      • Mirror Selected Object in Y.
      • Mirror Selected Object in Z.
      • Drop to Floor.
    • Text editor.
      • CTRL+F - Find.
      • F3 - Find Next.
      • Shift+F3 -Find Previous.
      • F5 - Compile Script.
    • Debugger.
      • The “Event Log” buffer is about 1000 lines * 80 characters, i.e. about 64 KBytes of text.
      • When the button “Toggle Script Debugger” is activated, the debugger “compiles” a LUA script as soon as it is loaded into the internal editor, by the message “Successfully compiled script XXXX !”.
    • 2021-03-03, Update 2.1.20.0 - “In the meantime, the only way to exit Home World or the game you are in is to pull-up the ESC menu/Games Browser and select another game, 'Create', or 'My Collection'. Any one of these will cause you to exit the current game or Home World without exiting the Core program”.
  • Typical application keys:
    • W,A,S,D - Move the character.
    • SPACE - Jump.
    • C - Crouch.
    • G - Ride a mount.
    • F - Get into interaction ( e.g. open and close a door ).
    • H - Help ( uncommon, T is more common ).
    • I - Inventory.
    • J - Journal.
    • L - Loot.
    • M - Map.
    • R - Reload.
    • Shoot the default gun with the left mouse button.
    • T - Tutorial / Help. “Press 'T' to open and close this window” :-).
    • U - Upgrade.
    • P - Scorecard.
    • V - Tournament Rating.
    • V - Video ( Preview videos with camera pan of certain areas of the playground )
    • TAB - Scoreboard.
    • Tool / weapon change:
      • Q - Change tool / weapon +1 ( down ).
      • R - Change tool / weapon -1 ( up ).
      • 1 - Use tool / weapon #1.
      • 2 = Use tool / weapon #2.
      • 3 = Use tool / weapon #3.
  • “Some of those special icons are rewards for winning contests, jams, etc. that are given to users who have won them. We often use these icons as prizes for winning”.
  • The function “Reset relative transform, Keep Child World Transform” is available for groups & folders, may be used to set the position of a group or folder to 0,0,0, relative to the upper directory structure object. So best ist to start with a group for each project-specific stuff, and to create a sub-structure of groups for any group of items. The function is not available for objects.
  • List of forbidden word in CORE chat, in the CORE IDE, which are is printed as 4 Stars ( “* * * *” ):
    1. “GIMP” ( the name of the OpenSource image processing tool ).
  • CORE Forums "Change directly from the Startpoint to Create-Mode" - If you are developer and don´t want to enter “Core World” at IDE startup, add ”-CREATE” in the properties. E.g.
    C:\ProgramData\Manticore Games\Launcher\Core Launcher.exe" -CREATE
    

Forums, Newsgroups

 
en/coregames02.html.txt · Last modified: 2021/09/25 12:04 (external edit) · []
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki