• Pragma - A 3D multiplayer sandbox engine with Lua-integration, based on Vulkan and bullet physics
    379 replies, posted
[QUOTE=pleasure;52710366]How about addons.That idea is alive?[/QUOTE] Not quite sure what you mean. There's an [URL=https://youtu.be/rN84vp6NDxs]addon system[/URL] and a modding hub with a few addons (Most of them just example addons from me though): [url]https://mods.pragma-engine.com/[/url]
Just a quick question, what enhancements does Pragma have over Gmod currently? I'm thinking of porting or remaking some mods (specifically, Ragdoll Mover) and making comics on Pragma at some point. Does it have decimal precision for maps for example?
[QUOTE=McDoomington;52718888]Just a quick question, what enhancements does Pragma have over Gmod currently? I'm thinking of porting or remaking some mods (specifically, Ragdoll Mover) and making comics on Pragma at some point. Does it have decimal precision for maps for example?[/QUOTE] Pretty sure that maps use doubles, which have more than enough precision for way past the billions of units. This engine is by no means complete whatsoever, there are still a metric ton of things and bugs that need to be done and fixed. Though unlimited map size is one of the benefits. As well as using Vulkan over DirectX so in the future, performance should be very good. I do have my own questions as well Silverlan, is this engine basically an attempt at substituting Source 2? And if so, do you plan to do anything if Source 2 is ever released? Or are you going to carry on doing what you're doing?
[QUOTE=RileyGuy1000;52720812]Pretty sure that maps use doubles, which have more than enough precision for way past the billions of units. This engine is by no means complete whatsoever, there are still a metric ton of things and bugs that need to be done and fixed. Though unlimited map size is one of the benefits. As well as using Vulkan over DirectX so in the future, performance should be very good. I do have my own questions as well Silverlan, is this engine basically an attempt at substituting Source 2? And if so, do you plan to do anything if Source 2 is ever released? Or are you going to carry on doing what you're doing?[/QUOTE] This is a single guys project. I love the direction hes taken and the skill required to get here, but it would be rather unfair to compare his engine to that of a multimillion dollar company, dont you think?
[QUOTE=da space core;52720830]This is a single guys project. I love the direction hes taken and the skill required to get here, but it would be rather unfair to compare his engine to that of a multimillion dollar company, dont you think?[/QUOTE] Not really, said engine is pretty old by now (the Half-Life 2 version, the forks used for Portal 2, Left 4 Dead 2, Counter-Strike: Global Offensive, DOTA, etc are vastly improved), so he's got at least some advantages over it.
[QUOTE=McDoomington;52718888]Just a quick question, what enhancements does Pragma have over Gmod currently?[/QUOTE] For end-users not that much, but quite a few things for modders: • Proper class system for Lua (With multiple class inheritance, etc.) • Live Coding and support for ZeroBrane (Which allows you to debug code by stepping through it, among other things) • Resources are reloaded on the fly when changed (No need to restart the game every time) • Deeper access to the engine (e.g. full access to [URL=https://wiki.pragma-engine.com/index.php?title=Model]models[/URL], [URL=https://wiki.pragma-engine.com/index.php?title=Phys]physics[/URL], more [URL=https://wiki.pragma-engine.com/index.php?title=Math]math[/URL] libraries and classes, full access to the shader system and low-level vulkan functions, etc.) • No arbitrary limits (e.g. map size) • Nothing is static (No static lighting or static level geometry, everything can be changed at runtime) • etc. [QUOTE=McDoomington;52718888]I'm thinking of porting or remaking some mods (specifically, Ragdoll Mover) and making comics on Pragma at some point.[/QUOTE] There's no face-posing or anything like that yet, but I'm planning on looking into that soon. As for ragdoll moving, I've created a physics gun as an example mod which can kind of do that: [url=https://mods.pragma-engine.com/index.php?mode=upload&uploadid=0eed704eb4c3af5874c1633f661a8abe][img]https://mods.pragma-engine.com/download.php?uploadid=0eed704eb4c3af5874c1633f661a 8abe&output=image[/img][/url] It's a little iffy and limited when using it with ragdolls right now, I'll have to update it at some point. [QUOTE=McDoomington;52718888]Does it have decimal precision for maps for example?[/QUOTE] You mean double precision? For physics, yes, but not for rendering, but I think the [URL=https://youtu.be/Q5g53fpQ_RI]map size[/URL] is more than enough either way. [QUOTE=RileyGuy1000;52720812]I do have my own questions as well Silverlan, is this engine basically an attempt at substituting Source 2? And if so, do you plan to do anything if Source 2 is ever released? Or are you going to carry on doing what you're doing?[/QUOTE] What I'm doing is very different from what valve is doing, I'm not trying to copy the source engine. I have my doubts source 2 is ever going to be released publically, but it wouldn't change anything either way. Anyway, I've finally fixed the issues I had with soft-body physics: [video]https://youtu.be/ap2M2Ff6470[/video] Still need to optimize it a little, but it's almost done.
wow we can have jiggle physics now
Would you ever be willing to set your game up to work with JavaScript, C#, etc? It looks great, but I'd enjoy either of those languages a lot more.
[QUOTE=wauterboi;52722425]Would you ever be willing to set your game up to work with JavaScript, C#, etc? It looks great, but I'd enjoy either of those languages a lot more.[/QUOTE] What is it that you don't like about Lua? Lua in pragma is a little different compared to gmod: • Thanks to luabind there's a proper class system with support for multiple inheritance and a bunch of other neat features • Using the ZeroBrane IDE, you can [URL=https://youtu.be/pm73zJIQwUo]debug Lua-code[/URL] by adding breakpoints, stepping through it line by line, analyzing variables, etc. • There's also an [URL=http://sciolyte.com/sharex/2017-07-26_00-00-25.gif]autocomplete script[/URL] for pragma which you can use for ZeroBrane • You can live-code without ever having to close the game or reload the map. [URL=https://youtu.be/vJphoc62EH8]Here's a video[/URL] of me creating a new NPC entirely during runtime. • Lua errors give you [URL=http://sciolyte.com/sharex/pragma_2017-09-28_14-06-19.png]more information[/URL] and immediately show you the line where the error occurred • LuaJIT is still the fastest scripting language around, as far as I know. I don't like JavaScript at all personally, but I guess that's just preference. I also have no idea if C# works on Linux.
[QUOTE=Silverlan;52725611]I also have no idea if C# works on Linux.[/QUOTE] It does but its not amazing, gotta use mono in one way or another for it to work under Linux, its not worth the effort when you've already got Lua. Nothing to stop having an interpreter though that can take code from one language and turn it into another that the game runs, but again. Effort and comes with its own problems with languages doing stuff very differently, opens up a massive bag of worms.
[QUOTE=Silverlan;52721823]There's no face-posing or anything like that yet, but I'm planning on looking into that soon. As for ragdoll moving, I've created a physics gun as an example mod which can kind of do that. It's a little iffy and limited when using it with ragdolls right now, I'll have to update it at some point[/QUOTE]Yeah, I need something more precise. I or someone else will have to port/remake the ragdoll mover. I appreciate having the physgun the Ragdoll mover tool is so much better. [QUOTE=Silverlan;52721823]You mean double precision? For physics, yes, but not for rendering, but I think the map size is more than enough either way.[/QUOTE]I've mostly heard it called decimal precision. But yes. I've been thinking of making a space ship map, I need to get around to making the brush textures some time. But it's nice to know I can have nice curves for it. Also, this is unrelated to the engine I'm working on a character creator for Source (specifically, Gmod and SFM, but I'm all for using it in mods as long they don't require money), if I ever get around to actually making it, would you be interested in helping program it? (I guessing the answer is no since you're busy with this and it's a lot to ask even to someone who isn't busy, but I figure I should ask anyway because, well, I'll probably never find a programmer/coder for it if I don't ask occasionally).
[QUOTE=Silverlan;52725611]What is it that you don't like about Lua?[/quote] Well, quite a bit actually. A lot of it can be traced back to the things Garry doesn't like about Lua, which includes the non-conformity to other languages. Keywords like "then" and "end" in place of brackets, the arbitrary changing or lack of operators (the lack of increment and decrement operators), the starting of table indices at 1 instead of 0... I could go on and on about it. But the killer for me is the lack of a proper class/library system and the emphasis on metatables. Hopefully you address the last one well. [QUOTE=Silverlan;52725611]Lua in pragma is a little different compared to gmod: • Thanks to luabind there's a proper class system with support for multiple inheritance and a bunch of other neat features[/quote] You should write about this! I'd love to hear what you've got going in that department. [QUOTE=Silverlan;52725611]I don't like JavaScript at all personally, but I guess that's just preference.[/quote] Exactly - it's preference. I could script in Lua, but I'd rather not. I'm more comfortable in C# and TypeScript. It's partially because both C# and TypeScript follow common conventions and working between both doesn't feel as jarring as working between those languages and C#, but also because those languages are more regularly used. Lua is a bit of a dead-end in development in comparison to C# and JavaScript. And those who dislike JavaScript can use TypeScript to make conventions more like C#, and also ensure their scripts are type-safe! Further more, if you can provide access to the [url=https://www.npmjs.com/]npm[/url] with Node.js, that means that not only would people have access to the vast amount of libraries available, but users could potentially upload their own libraries for ease of use with other scripts. C# also has NuGet, but I haven't dabbled with that too much outside of using the occasional framework like Sinatra. [QUOTE=Silverlan;52725611]I also have no idea if C# works on Linux.[/QUOTE] Microsoft supports C# on Linux via .NET core, and there's also Mono. In all honesty, though, I think having JavaScript as an option is enough.
[QUOTE=wauterboi;52726279]Well, quite a bit actually. A lot of it can be traced back to the things Garry doesn't like about Lua, which includes the non-conformity to other languages. Keywords like "then" and "end" in place of brackets, the arbitrary changing or lack of operators (the lack of increment and decrement operators), the starting of table indices at 1 instead of 0... I could go on and on about it. But the killer for me is the lack of a proper class/library system and the emphasis on metatables. Hopefully you address the last one well. You should write about this! I'd love to hear what you've got going in that department.[/QUOTE] No need for meta-table magic, if you want to add methods to existing classes, you can do so directly: [code] function Player:SetSpeed(speed) self:SetWalkSpeed(speed) self:SetRunSpeed(speed) self:SetCrouchedWalkSpeed(speed) end function Entity:DoStuff() -- ... end [/code] Usage: [i]local pl = ents.get_players()[1]; pl:SetSpeed(100.0); pl:DoStuff()[/i] As for the class system, here are some examples: [code] util.register_class("BaseProjectile",BaseEntity) -- Creates new class "BaseProjectile" derived from "BaseEntity" function BaseProjectile:Initialize() -- ... end function BaseProjectile:OnRemove() -- ... end -- etc -- Derived class util.register_class("ProjAcid",BaseProjectile) function ProjAcid:Initialize() BaseProjectile.Initialize(self) -- Calls the base-class method, can be omitted -- ... end function ProjAcid:OnRemove() -- BaseProjectile.OnRemove() end ents.register("projectile_acid",ProjAcid) [/code] Example for multiple inheritance: [code] util.register_class("ParentClass1") function ParentClass1:__init() console.print("ParentClass1") end util.register_class("ParentClass2") function ParentClass2:__init() console.print("ParentClass2") end util.register_class("ChildClass",ParentClass1,ParentClass2) function ChildClass:__init() console.print("ChildClass") ParentClass2.__init(self) ParentClass1.__init(self) end function ChildClass:__mul(other) console.print("__mul"); return 1 end local o1 = ChildClass() local o2 = ChildClass() local r = o1 *o2 [/code] Diamond inheritance: [code] -- Simple entity simulating a drone util.register_class("PhysDrone",BaseEntity) function PhysDrone:Initialize() -- ... end ents.register("phys_drone",PhysDrone) -- Drone with additional AI-behavior util.register_class("NPCDrone",BaseNPC,PhysDrone) -- BaseNPC and PhysDrone are both derived from BaseEntity function NPCDrone:Initialize() BaseNPC.Initialize(self) PhysDrone.Initialize(self) end ents.register("npc_drone",NPCDrone) -- Drone as a vehicle util.register_class("VHCDrone",BaseVehicle,PhysDrone) function VHCDrone:Initialize() BaseVehicle.Initialize(self) VHCDrone.Initialize(self) end ents.register("vhc_drone",VHCDrone) [/code] You can derive from almost all of the C++-defined classes if you want to: [code] util.register_class("VectorDerived",Vector) function VectorDerived:__init() Vector.__init(self) end local v = VectorDerived() v.x = 5.0 print("V: ",v.x) [/code] As a side note: Entity scripts are automatically reloaded when one of their files is changed. The changes apply to all already spawned entities as well, allowing you to make changes and see the effect immediately. Pragma also supports pre-compiled Lua files, which can be used to improve load times slightly (and/or to obfuscate code). [i]include[/i]-calls are also cached by default.
[QUOTE=wauterboi;52726279]-stuff-[/QUOTE] Something to think about is that languages like Lua and Python are scripting languages which are intended to let users write as much function as quickly as possible. With that you make sacrifices compared to lower-level languages.
Any chance you'll ever implement some sort of static lighting or lightmaps, even if just for brushes? Lightmaps in Source can look really, really good. The lighting really pops out. [t]http://media.moddb.com/images/mods/1/13/12033/2a.jpg[/t] Dynamic lighting is great for moving objects and changing time of day etc., but overall it feels sort of dull and flat compared to a lot of lightmaps (esp. Source) and I can't put my finger on exactly why. Or maybe it's just that I don't understand lighting at all and it's possible to get great looking dynamic lighting, too. Edit: I messed around in the engine for a few minutes. Physics were buggy. When looking down and holding W, I didn't move at all and sometimes the lighting glitched out. [video=youtube;3fhfVE1w7nk]https://www.youtube.com/watch?v=3fhfVE1w7nk[/video] The main issue I noticed when messing around was that while walking around I experienced subtle but noticeable skipping and jittering in my movement, and collision was acting weird when I brushed up against things. Other than that it's improved a lot since I last played it, especially visually.
SSL certificate expired on wiki.pragma-engine.com, or is it just me? Just tried it, i hope its still being developed and in maybe a few years something, people actually want to play. i would be definately one of them! Here are a few bugs i noticed: -CLIP brush is visible on speedway map. -very poor performance, around 10fps. -White bar creeping up from the bottom. (causing major fps drop). only appear on non terrain. [url]https://i.imgur.com/a0KsJpX.jpg[/url] Even the player waist got that. -player doesnt move into the Car, it stands outside. -Player rendering weird when in a car [url]https://i.imgur.com/aSpVeSI.jpg[/url] -Cars got no wheels -props cannot be interacted with, seems to befrozen. -no weapons to change to, no weapons in the weapons tab (sandbox menu) -fullscreen not applying when changed in settings. [url]https://i.imgur.com/iIGGzgv.jpg[/url] -missing localization and content for Tools tab in sandbox menu -flashing shadows / switching light -view slowly moving upwards, but not when alt-tabbed out or paused -high jumping, moon gravity? -flashlight light only affects road and barriers, not terrain -error.wmd invisible -crashed when hitting Quit. crashdump included: [url]https://drive.google.com/uc?id=0B1m9gzDM5Ae-ZnozMlgwTzJvSms[/url]
I have a problem when i started it up i got a termial error Do i need to install vulkan Support Driver?
Just noticed a new video was added https://youtu.be/hY2BSht_goI
Very interesting, I'll have to test it out myself and see how I like it
Finally gave in and added lightmap support: https://youtu.be/uRKMx3VZBPI Doesn't work with displacements yet, haven't quite figured out how that works. Anyway, since I haven't posted any updates here lately, here's a short overview of the major new changes: • Pragma is now available on steam (although not public) with workshop support. I give out keys to anyone who wants one. • Support for lightmaps and BSP-culling • Entirely rewrote the entity-system, it's now based on an entity-component-system instead of an inheritance model. • Direct support for loading VMF- and BSP-maps (custom compiler for hammer is now obsolete) • Lots of bug-fixes and general improvements • There's now a 'mini'-wiki included in Pragma for Lua-developers: https://pragma-engine.com/sharex/pragma_2019-01-01_15-31-25.png https://pragma-engine.com/sharex/pragma_2019-01-01_15-13-35.png Lua-errors also display the closest match from the wiki-data of whatever caused the error, and if ZeroBrane is installed it will automatically open the file and go to the line which caused the error. Full Changelog. Some other random media: https://youtu.be/1uCRftDcvD4 https://youtu.be/Z0DnguHp320 http://pragma-engine.com/sharex/pragma_2018-12-17_19-19-03.jpg
In my opinion, this was an extremely good idea. I have personally never been a fan of inheritance in OOP. It might be considered treasonous to say, but I've always found it bulky, obtuse, prone to a lot of garbage, and overall just a headache to work with. Especially when you find yourself thinking "I need multi-parent inheritance" and then do exactly that without thinking maybe you're approaching it the wrong way. Entity components have always been my solution to this problem, before I even knew there was a term for it. It just always made more sense to me. Glad to see you decided to do that, even though I can only imagine how much of a headache converting the entire existing base over was.
Yeah, I had to use virtual inheritance in one or two cases I'd rather not talk about. Inheritance was also very problematic with the kind of server-client model I'm using, but switching to an entity-component-model essentially solved all of my problems at once. It took a few months to implement (since I more or less had to rewrite all of my entities, too), but it was definitely worth it. I love how it came out and how flexible it all is now. util.register_class("ents.NPCZombieComponent",ents.BaseEntityComponent) local cvHealth = console.register_variable("sk_zombie_health","100",bit.bor(console.FLAG_BIT_ARCHIVE,console.FLAG_BIT_REPLICATED),"Specifies the zombie's default health.") function ents.NPCZombieComponent:Initialize() self:AddEntityComponent(ents.COMPONENT_CHARACTER,"InitializeCharacter") self:AddEntityComponent(ents.COMPONENT_AI,"InitializeAI") self:AddEntityComponent(ents.COMPONENT_HEALTH,"InitializeHealth") self:AddEntityComponent(ents.COMPONENT_TRANSFORM,"InitializeTransform") self:AddEntityComponent(ents.COMPONENT_PHYSICS,"InitializePhysics") self:AddEntityComponent(ents.COMPONENT_MODEL,"InitializeModel") self:AddEntityComponent(ents.COMPONENT_DAMAGEABLE) self:AddEntityComponent(ents.COMPONENT_SOUND_EMITTER) self:AddEntityComponent(ents.COMPONENT_ANIMATED,"InitializeAnimated") self:AddEntityComponent(ents.COMPONENT_LOGIC) if(SERVER == true) then self:BindEvent(ents.AIComponent.EVENT_SELECT_SCHEDULE,"SelectSchedule")     self:BindEvent(ents.AIComponent.EVENT_SELECT_CONTROLLER_SCHEDULE,"SelectControllerSchedule") self:BindEvent(ents.AIComponent.EVENT_ON_PRIMARY_TARGET_CHANGED,"OnPrimaryTargetChanged") self:BindEvent(ents.AIComponent.EVENT_ON_NPC_STATE_CHANGED,"OnNPCStateChanged") self:BindEvent(ents.AIComponent.EVENT_ON_TARGET_ACQUIRED,"OnTargetAcquired") self:BindEvent(ents.HealthComponent.EVENT_ON_HEALTH_CHANGED,"OnHealthChanged") self:BindEvent(ents.LogicComponent,"OnTick") self.m_tNextIdle = 0 end self:BindEvent(ents.AnimatedComponent.EVENT_HANDLE_ANIMATION_EVENT,"HandleAnimationEvent") if(SERVER == true) then self:InitializeSchedules() end end function ents.NPCZombieComponent:InitializeAnimated(component) component:BindAnimationEvent(Animation.EVENT_SCRIPT_SOUND,self,"PlayScriptSound") if(SERVER == true) then component:BindAnimationEvent(Animation.EVENT_NPC_1,function() -- First swipe of first melee attack self:DealMeleeDamage(EulerAngles(-8,-52,-12)) end) component:BindAnimationEvent(Animation.EVENT_NPC_2,function() -- Second swipe of first melee attack self:DealMeleeDamage(EulerAngles(-8,52,-12)) end) component:BindAnimationEvent(Animation.EVENT_NPC_3,function() -- Second melee attack (Only has one swipe) self:DealMeleeDamage(EulerAngles(60,0,0)) end) component:BindAnimationEvent(Animation.EVENT_NPC_BODYDROP_LIGHT,self,"DropBody") end end function ents.NPCZombieComponent:InitializeAI(component) if(SERVER) then component:SetHearingStrength(0.6) -- Use 0.0 to disable the NPCs ability to hear, 1.0 means perfect hearing component:SetNPCState(ai.NPC_STATE_IDLE) end component:SetMoveSpeed("walk",50.0) -- We don't use animation movement, so we have to specify a constant movement speed here end function ents.NPCZombieComponent:InitializeHealth(component) component:SetHealth(cvHealth:GetInt()) end function ents.NPCZombieComponent:InitializeTransform(component) component:SetScale(math.randomf(0.9,1.1)) -- Give our NPC a random scale (It will sometimes spawn slightly smaller, sometimes larger than normal) end function ents.NPCZombieComponent:OnEntitySpawn() local physComponent = self:GetEntity():GetComponent(ents.COMPONENT_PHYSICS) if(physComponent ~= nil) then physComponent:SetCollisionBounds(Vector(-16,0,-16),Vector(16,72,16)) -- Our collision bounds in units (Width, length = 16 and height = 72) end if(CLIENT or physComponent == nil) then return end physComponent:InitializePhysics(phys.TYPE_CAPSULECONTROLLER) -- Initialize our physics as a capsule. end function ents.NPCZombieComponent:InitializePhysics(component) component:SetMoveType(ents.PhysicsComponent.MOVETYPE_WALK) -- Our NPC is ground-based end ents.COMPONENT_NPC_ZOMBIE = ents.register_component(ents.NPCZombieComponent,ents.EntityComponent.FREGISTER_BIT_NETWORKED) ents.register("npc_zombie",{ents.COMPONENT_NPC_ZOMBIE},Entity.TYPE_SHARED) All in all there are over a hundred components now: http://pragma-engine.com/sharex/components.png Also, unrelated, but words can't describe how much I loathe Facepunch's WYSIWYG editor, jfc, had to rewrite this post 3 times and it completely screws up code formatting. :/
I completely forgot about this thread, good to see it survived the jump to newpunch.
https://youtu.be/8WvvnuhDgwM Well, sort of, this is the old thread. I created a newer one in the videos sub-forum, which was supposed to replace this one, but then that sub-forum got purged . I also had to redo the entire first post because it was completely broken.
survival of the fittest thread
Also, as a friendly reminder, if you ever find yourself returning to building Pragma Filmmaker, please don't hesitate to ask me any questions regarding how SFM works, on a UX or technical level. Myself and my compatriots have long since given up hope of ever getting a Source Filmmaker that's out of beta, let alone a Source Filmmaker 2. If you had any stock for me to invest in, then I'd be investing all of my stock into PFM. I wholeheartedly and legitimately believe that Pragma can easily dethrone and surpass SFM. The engine has amazing capabilities, and your emphasis on full compatibility with Source 1 assets is absolutely invaluable for the existing Source community. Answering a few questions is literally the absolute least I could contribute to this project.
Finally managed to get lightmaps working with displacements, that was a massive pain in the ass and a thorn in my side for months. http://pragma-engine.com/sharex/pragma_2019-02-16_12-02-00.jpg It was never my intention to create a filmmaker, I just wanted to import SFM scenes to see if I could . That being said, it's a very appealing idea, but it's something I'd only consider if I knew there was a lot of interest in something like that, and I don't think I could do it without some sort of Patreon support either (it'd be months and months of work after all, I really don't have the finances to justify that otherwise).
Hello. How can I obtain steam key for Pragma?
You can join the discord server and check out the pinned message, I've posted a bunch of keys there. Otherwise you can just add me on steam and I'll send you one. I'd send you one via PM on facepunch, but you know...
Would it be feasible to turn Pragma into a multi platform engine or does the engine depend heavily on Windows only libraries?
Sorry, you need to Log In to post a reply to this thread.