winterleaf / omniengine.net Goto Github PK
View Code? Open in Web Editor NEWOfficial repository for the Omni T3D Game Engine
Official repository for the Omni T3D Game Engine
As in this resource, reported here.
http://www.garagegames.com/community/resources/view/22293
This is the resource. this feature is still missing.
Hey, I've been learning a bit more about C# and I have a new proposal for the SimObject system, to replace this syntax:
SimObject sim = 42;
sim["Fish"] = 2;
Console.WriteLine(sim["Fish"] + sim.mID);
SimObject sim = (dynamic)new TorqueID(42);
sim.Dynamics.Fish = 2;
Console.WriteLine(sim.Dynamics.Fish + sim.mID);
It's more verbose but I think it's clearer what happens. Also, this has the advantage of not having to create implicit converters for each of the inherited classes.
Using:
class TorqueID : DynamicObject
{
private int mID;
public TorqueID(int ID)
{
mID = ID;
}
public override bool TryConvert(ConvertBinder binder, out object result)
{
if (binder.Type.GetConstructor(new Type[] { typeof(int) }) != null)
{
result = Activator.CreateInstance(binder.Type, mID);
return true;
}
result = null;
return false;
}
}
Makes the TorqueID class implicitly convert to any class with a constructor of format: "public C(int id)" which it's fair to assume that each SimObject will have. Which means the boiler plate code for SimObject is nothing more than:
class SimObject
{
public int mID;
public dynamic Dynamics;
public SimObject(int ID)
{
mID = ID;
Dynamics = new DynamicVariables(mID);
}
}
class DerivedSimObject : SimObject
{
public DerivedSimObject(int ID)
: base(ID)
{
}
}
Ofc, this introduces dynamics which means types will be evaluated at run-time. But this makes sense when you consider that it's modelled to match TorqueScript. You can find a Gist of a minimal running example here.
I'm not completely done with rethinking the SimObjects, I'm gonna look at object instancing next.
Thoughts?
Paul mentioned we should remember to put in the proper license headers in the files on the repo.
SimpleNetObject is just an example object and should be removed from the SimObject based classes, as it creates issues in the SafeNativeMethods.cs file. This is probably because SimpleNetObject has it's class definition inside the .cpp file and not the .h file. It doesn't have any relevance to the actual game logic so it should just not be generated at all.
I can't change this, as it is a StaticCodeGenerator issue.
Partially solves #20.
use pop out windows to give side to side view, regular flight controls
basic car racing... cars, track, scenery.....
make a very basic template that gives starter RPG/MMO Style functionality
I really wanna clean up object creation.
new A() { new B(){}; };
Is just syntactic sugar for:
new A() {};
new B() {};
A.add(B);
So instead of this:
oc_Newobject4["#Newobject1"] = oc_Newobject1;
We could have this:
SimSet set = oc_Newobject4.create();
set.add(oc_Newobject1.create());
And we should use named parameters in the constructors so that instead of this:
ObjectCreator oc_Newobject4 = new ObjectCreator("GuiWindowCtrl", "ConsoleDlgWindow", typeof (ConsoleDlgWindow));
oc_Newobject4["isContainer"] = "1";
oc_Newobject4["AllowPopWindow"] = "1";
We should have:
// Have to have GuiWindowCtrl constructor in a seperate class to avoid boilerplate constructors in
// classes derived from GuiWindowCtrl.
GuiWindowCtrl oc_Newobject4 = new GuiWindowCtrlInstance(name: "ConsoleDlgWindow", isContainer: true, AllowPopWindow: true);
// Alternately
GuiWindowCtrl oc_Newobject4 = (new GuiWindowCtrlInstance("ConsoleDlgWindow")
{
isContainer = true,
AllowPopWindow = true
}).create();
Using the package manager to create a new project based on Empty (C#), then compiling the engine and compiling the C# gives 9 errors:
Error 1809 'WinterLeaf.Engine.Classes.Interopt.pInvokes.UtilObject' does not contain a definition for 'closeSplashWindow' and no extension method 'closeSplashWindow' accepting a first argument of type 'WinterLeaf.Engine.Classes.Interopt.pInvokes.UtilObject' could be found (are you missing a using directive or an assembly reference?) E:\GitHub\OmniEngine.Net\My Projects\TestProject\Winterleaf.Demo.Full\Models.User\GameCode\Main.cs 198 31 Winterleaf.Demo.Full
Error 1811 The best overloaded method match for 'WinterLeaf.Engine.Omni.fnTCPObject_listen(string, int)' has some invalid arguments E:\GitHub\OmniEngine.Net\My Projects\TestProject\Winterleaf.Demo.Full\Models.Base\TCPObject_Base.cs 208 1 Winterleaf.Demo.Full
Error 1812 Argument 2: cannot convert from 'uint' to 'int' E:\GitHub\OmniEngine.Net\My Projects\TestProject\Winterleaf.Demo.Full\Models.Base\TCPObject_Base.cs 208 39 Winterleaf.Demo.Full
Error 1821 'WinterLeaf.Engine.Omni' does not contain a definition for 'fnAIPlayer_checkInFoV' and no extension method 'fnAIPlayer_checkInFoV' accepting a first argument of type 'WinterLeaf.Engine.Omni' could be found (are you missing a using directive or an assembly reference?) E:\GitHub\OmniEngine.Net\My Projects\TestProject\Winterleaf.Demo.Full\Models.Base\AIPlayer_Base.cs 324 22 Winterleaf.Demo.Full
Error 1822 'WinterLeaf.Engine.Omni' does not contain a definition for 'fnAIPlayer_checkInLos' and no extension method 'fnAIPlayer_checkInLos' accepting a first argument of type 'WinterLeaf.Engine.Omni' could be found (are you missing a using directive or an assembly reference?) E:\GitHub\OmniEngine.Net\My Projects\TestProject\Winterleaf.Demo.Full\Models.Base\AIPlayer_Base.cs 337 22 Winterleaf.Demo.Full
Error 1827 'WinterLeaf.Engine.Omni' does not contain a definition for 'fnGuiCanvas_hideWindow' and no extension method 'fnGuiCanvas_hideWindow' accepting a first argument of type 'WinterLeaf.Engine.Omni' could be found (are you missing a using directive or an assembly reference?) E:\GitHub\OmniEngine.Net\My Projects\TestProject\Winterleaf.Demo.Full\Models.Base\GuiCanvas_Base.cs 510 15 Winterleaf.Demo.Full
Error 1828 No overload for method 'fn_TerrainEditor_autoMaterialLayer' takes 6 arguments E:\GitHub\OmniEngine.Net\My Projects\TestProject\Winterleaf.Demo.Full\Models.Base\TerrainEditor_Base.cs 513 1 Winterleaf.Demo.Full
Error 1832 'WinterLeaf.Engine.Omni' does not contain a definition for 'fnGuiCanvas_showWindow' and no extension method 'fnGuiCanvas_showWindow' accepting a first argument of type 'WinterLeaf.Engine.Omni' could be found (are you missing a using directive or an assembly reference?) E:\GitHub\OmniEngine.Net\My Projects\TestProject\Winterleaf.Demo.Full\Models.Base\GuiCanvas_Base.cs 683 15 Winterleaf.Demo.Full
Error 1839 Metadata file 'E:\GitHub\OmniEngine.Net\My Projects\TestProject\game\Winterleaf.Demo.Full.dll' could not be found E:\GitHub\OmniEngine.Net\My Projects\TestProject\Winterleaf.Game\CSC Winterleaf.Game
I'll try running the static code generator and see if it fixes things.
Edit:
There is a basic FPS Template (either the Full or Empty) but it needs to be updated for a more FPS specific scenarios
Why is the Models.Base folder in the game code project? Surely, this folder reflects the engine structure, and therefore it should be in the Winterleaf.Engine project.
Also whats the purpose of the "Extendable" folder, it seems like it isn't meant to be fiddled with just like the Models.Base folder, so whats its purpose? What does it add that you couldn't just get from the Models.Base classes to begin with? Edit: Nvm, I see it's for inheritance
Winterleaf.Demo.Full should just have "CustomObjects" and "GameCode".
As described in: GarageGames/Torque3D#1106
ModelBase::isMethod should look like this:
public virtual bool isMethod(string method)
{
return Omni.self.fn_SimObject_isMethod(ID, method);
}
If you call this function then the engine will go into endless-loop if you haven't defined the function in C#. Should it be:
Winterleaf_EngineCallback::mWLE_gIsFunction("Quit")
? If I do that, it seems like the engine wont shut down.
a Template that's empty. has no game logic, but has a camera that moves
Whats the difference between Omni.self
and private static readonly pInvokes omni = new pInvokes();
? Why do we have both? Can we possibly remove one of them so there's a single interface for interacting with the engine?
There's both "AsUInt" and "AsUint", whats the difference? Seems like "AsUInt" is simply a newer version of "AsUint".
get rid of all the "T3D" UI graphics that are in the Project Manager AND the TS builds. There should be good and working examples in the C# builds
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.