• Pragma - A work-in-progress multiplayer sandbox engine
    155 replies, posted
So OpenSource Source...Source?
[QUOTE=Silverlan;52491379] Working on some wall-moving for players and NPCs right now, just need to fix the janky camera[/QUOTE] Anyone else remember The specialists? Getting that vibe from watching that. Other than that this looks all very promising. Good work!
I saw this around earlier, and was really hoping there was some source code around as its hard to find code from game engines and projects using Vulkan. The API is still so young that there's not a lot of reference material - makes it doubly impressive that you've got it working so well, though. I'd be lying if I didn't say I loved this API, though. From writing a vkDeviceMemory allocator to getting all fiddly with device queue families and such, its fun having that much power and granular control at your fingertips. [sp]except how multi-GPU stuff works oh god please no[/sp] kudos to you though, this is a seriously impressive project. It all looks quite good and appears to handle/behave really really well. If you do open-source parts of it, I couldn't thank you enough for doing that as open-sourced projects are how I've learned to program in C++ primarily, and I really wish there were more of them using Vulkan right now.
[QUOTE=Solomon;52492847]Why not simultaneous map loading so you can load two maps at once[/QUOTE] Already got that planned, you'll be able to load multiple maps simultaneously. Anyway, there's one (kind of) way to create larger maps in hammer. You can increase the maximum grid size in the .fgd-settings: [T]http://sciolyte.com/sharex/hammer_2017-07-21_21-23-51.png[/T] You can still save and compile the map, you just can't load it again in hammer afterwards. I've just tested it ingame, if I get to a corner of that map (2000000x2000000 in size), you notice some small visual glitches, but it's still playable. Since the physics are using double precision, they're fine anyway. The player's speed is about 250 units per second when sprinting, so it would approximately take you about 7.5 hours to cross the diagonal of that map. [QUOTE=Vasili;52492890]So you mentioned this is similar to Gmod, but what separates the two? From what I'm looking at your engine is more of a early version of Garry's Mod with a more modding friendly environment?[/QUOTE] • Maps and lighting in GMod/source are static and cannot be changed. In my engine I make sure to keep everything as dynamic as possible. • You can join servers with a lot of custom content with barely any loading times. All game resources are downloaded and loaded during runtime. Only the map and Lua-scripts have to be downloaded before you can start playing, which hardly matters because maps are very small anyway (because they contain no lighting data). • Many systems in GMod/source are out-dated (source is over a decade old after all), like the AI system. My AI-system uses behavior trees for example, which weren't even a thing in 2005. • Since I have full control over the engine, I can give modders far more control than would ever be possible with GMod/source (e.g. custom shaders, full access to model and map objects, larger maps, etc.). • Lua-scripting is arguably easier somewhat easier because there's a proper class-system and you can debug Lua-code much more easily with break-points, step-by-step execution, etc (with use of the ZeroBrane IDE). • It's free. [QUOTE=paindoc;52493134]I saw this around earlier, and was really hoping there was some source code around as its hard to find code from game engines and projects using Vulkan. The API is still so young that there's not a lot of reference material - makes it doubly impressive that you've got it working so well, though. I'd be lying if I didn't say I loved this API, though. From writing a vkDeviceMemory allocator to getting all fiddly with device queue families and such, its fun having that much power and granular control at your fingertips. [sp]except how multi-GPU stuff works oh god please no[/sp][/QUOTE] You can kind of work with vulkan inside the engine with Lua: • [URL=https://wiki.pragma-engine.com/index.php?title=Vulkan]vulkan library[/URL] • Vulkan classes: [T]http://sciolyte.com/sharex/chrome_2017-07-21_21-30-37.png[/T] It's abstracted of course, so you don't have to deal with all of the details. It's also missing a lot of functions, I'll be adding those when there's demand for it. You can also write custom GLSL (HLSL should work too, haven't tested that) shaders and work with them in Lua.
[quote]hyooj maps[/quote] That's awesome. Imagine connecting popular maps together and traveling between them on vehicles you created yourself.
[QUOTE=Silverlan;52493244]-fuckhuge maps, cool vulkan bindings-[/QUOTE] Thats pretty neat! I was thinking of exporting some of the Vulkan bindings from my renderer to python, mostly to help me set up quick test scenes and such. Lots of Vulkan code (looking at you, textures) becomes boilerplate once you slap some abstraction on top of it. Being able to access command buffers with your code is neat though: that's something I really enjoy over OpenGL, as recording draw commands into command buffers just feels nice to use. How do you handle device queues and queue families? I've not figured out a good way to handle this yet. ATI cards have weird queue family setups, though, which have thrown me off and made my renderer crash pretty hard. Trying to get a hold of any available transfer queues has been tough, too. Pretty easy to run into threading issues with those. Dig the map sizes, too! Used to get really irritated with the map sizes in GMod, and how small they seemed. I'd love to see what some of the mapping duders on FP could do with this engine.
[QUOTE=thelurker1234;52492841]ctf_2fort (a small map) alone is about 500000 lines so uhh, good luck with that lmao. The best thing though, is that there likely is some crazy sod who has actually made a proper map with a text editor alone.[/QUOTE] I'm sure someone has tried out of curiosity, and it would be funny to try and make a simple room doing it. Everything you see there is only a single brush. Point is, it's easy to make shit compatible with hammer because of how it neatly structures the vmfs.
[QUOTE=unrezt;52493262]That's awesome. Imagine connecting popular maps together and traveling between them on vehicles you created yourself.[/QUOTE] stop you are making me dream... I want to recreate my V6 with its gearbox now. Huge maps are giving me hope for the possibility of actual Spacebuild, imagine ACTUAL SPACEBUILD. *drools*
[QUOTE=IAmAnooB;52493315]stop you are making me dream... I want to recreate my V6 with it's gearbox now. Huge maps are giving me hope for the possibility of actual Spacebuild, imagine ACTUAL SPACEBUILD. *drools*[/QUOTE] With the way it looks like he's doing gravity, you could do some spherical planet type shit. Would basically be Kerbal with gmod building style. Chill as fug
I remember this. Best of luck to you with this. I hope if you begin selling it or anything you keep the documentation for it in order.
Alright now you're just teasing us. :neat: [video=youtube;YDBjV6S2RX8]http://www.youtube.com/watch?v=YDBjV6S2RX8[/video]
sb_gooniverse_fuckhuge2.0 when? Really nice to see that this project is still ongoing, been fun seeing your progress pictures in various threads. Are you planning on adding SQLite to it as well? Because while MySQL is amazing for all kinds of online storage and data handling, SQLite would be much more suited for session data storage.
How exactly can I play a Source map on this? I tried putting the BSP in /maps as usual, but it didn't seem to load it.
[QUOTE=karimatrix;52492497] Great work, question about light sources. Is it possible to have day/night cycles?[/QUOTE] All lighting is dynamic, one of the videos in my first post shows some basic day/night cycle. [QUOTE=Thomas, TTC;52493333]With the way it looks like he's doing gravity, you could do some spherical planet type shit. Would basically be Kerbal with gmod building style. Chill as fug[/QUOTE] Sure. :v: [video]https://youtu.be/1qHrg0gHCvM[/video] • [URL=https://wiki.pragma-engine.com/index.php?title=Game_setgravity]game.set_gravity[/URL] • [URL=https://wiki.pragma-engine.com/index.php?title=Entity_setgravityoverride]Entity:SetGravityOverride[/URL] • [URL=https://wiki.pragma-engine.com/index.php?title=Entity_setgravityscale]Entity:SetGravityScale[/URL] • [URL=https://wiki.pragma-engine.com/index.php?title=PhysObj_setgravityoverride]phys.Object:SetGravityOverride[/URL] • [URL=https://wiki.pragma-engine.com/index.php?title=PhysObj_setgravityscale]phys.Object:SetGravityScale[/URL] The [i]sv_gravity[/i] console command and [i]game.set_gravity[/i] are equivalent and affect the entire scene, except for objects which have a custom gravity ("gravity override"). Gravity is a direction (default is "0 -600 0"), and you can change an entity's gravity direction individually, or just the gravity force, or both, or change it globally. [QUOTE=ace13;52493391] Are you planning on adding SQLite to it as well? Because while MySQL is amazing for all kinds of online storage and data handling, SQLite would be much more suited for session data storage.[/QUOTE] There's a MySQL module. I might look into SQLite at some point though. [QUOTE=Loadingue;52493402]How exactly can I play a Source map on this? I tried putting the BSP in /maps as usual, but it didn't seem to load it.[/QUOTE] BSPs can't be loaded directly, you have to decompile it, [URL=https://wiki.pragma-engine.com/index.php?title=Mapping]set up hammer for the engine[/URL] and recompile it with my compiler. I might add direct BSP support in the future, but the entities aren't compatible anyway.
Man this project is getting me way too excited. Maybe I'm a bit optimistic and hyped but I will dream of the day I can recreate this properly. [video]https://youtu.be/8luRxBEfQlA[/video] And I'd also would like to see SQLite, and see how seamlessly you can cross pieced together maps.
Silverlan, to what extent will imported maps work? My train maps have a load of different types of entities; doors, logics, triggers, etc. Will they be fugly?
[QUOTE=Giginigi;52493489]Silverlan, to what extent will imported maps work? My train maps have a load of different types of entities; doors, logics, triggers, etc. Will they be fugly?[/QUOTE] The compiler would have to recognize and have its own version of each entity. This would take quite a bit of time to make every entity type compatible. Even if you import bsps, there'd have to be some kind of conversion process to make them work with a new engine.
Seems easier to just make my own. Import models, get the entities working in the new way, and bam all good.
Holy fuck, is this the Xash3D to Source Engine? [editline]21st July 2017[/editline] Minus the heavy reverse engineering
This need some attention, perhabs you can set up donations?
Perhaps a goal or two on the patreon, and maybe some donation tiers with simple rewards? People are so much happier to donate if they know what's expected of them, and especially if they get something in return for it.
[QUOTE=Loadingue;52493402]How exactly can I play a Source map on this? I tried putting the BSP in /maps as usual, but it didn't seem to load it.[/QUOTE] [QUOTE=Giginigi;52493489]Silverlan, to what extent will imported maps work? My train maps have a load of different types of entities; doors, logics, triggers, etc. Will they be fugly?[/QUOTE] [QUOTE=Thomas, TTC;52493644]The compiler would have to recognize and have its own version of each entity. This would take quite a bit of time to make every entity type compatible. Even if you import bsps, there'd have to be some kind of conversion process to make them work with a new engine.[/QUOTE] I'm working on a BSP-loader right now, which will automatically convert BSP-maps into my map-format. Luckily the BSP-format is very straight-forward and well documented, so it should take a few days at most (map geometry already works, except for displacements). [T]http://sciolyte.com/sharex/pragma_2017-07-22_16-34-29.png[/T] Entities are going to be a bit problematic however. I could make it translate some entities reasonably well, others not so much. I'm not gonna re-create every single entity from the source engine, but I'll gladly take requests if specific ones are wanted. [QUOTE=ace13;52493391]Are you planning on adding SQLite to it as well? Because while MySQL is amazing for all kinds of online storage and data handling, SQLite would be much more suited for session data storage.[/QUOTE] [QUOTE=IAmAnooB;52493459]And I'd also would like to see SQLite, and see how seamlessly you can cross pieced together maps.[/QUOTE] What would be the advantage of SQLite over MySQL? If you want to use a local database, you can just install XAMPP or something similar and connect to that. Is there anything that SQLite can do that MySQL can't? [QUOTE=karimatrix;52495330]This need some attention, perhabs you can set up donations?[/QUOTE] [QUOTE=ace13;52495790]People are so much happier to donate if they know what's expected of them, and especially if they get something in return for it.[/QUOTE] I haven't had any ideas for what kind of rewards I could even give. There's no way for me to identify individual players ingame, that makes it a little difficult.
[QUOTE=Silverlan;52495829]What would be the advantage of SQLite over MySQL? If you want to use a local database, you can just install XAMPP or something similar and connect to that. Is there anything that SQLite can do that MySQL can't?[/QUOTE] Don't think of SQLite as a competitor for MySQL, their use cases are wildly different. SQLite is more of a competitor with the c-function fopen(). SQLite even supports opening the database ":memory:" for when you just need to temporarily store arbitrary data in a searchable manner, and it means you don't have to try and deal with global variables or memory management, the query optimizer even means that you don't have to worry about choosing good types or layout for your data. It's actually not that uncommon to run simpler kinds of games with SQLite as the only runtime data store, since that lets you do entity and level management with a well developed query language like SQL. Really, I've seen SQLite used as configuration files, game saves, level data, event logs, action/ability lists, inventory management, object relation tracking, entity-component systems, temporary storage for unloaded cells, and plenty more places. MySQL is the better choice when it comes to storing persistent database entries like account status or money in an RP gamemode, while SQLite is perfect for storing things like undo lists or window positioning in UI. [B]Edit:[/B] When it comes to patreon stuff, perhaps it might be worth doing weekly newsletters or something like that for people who donate? Access to your development trello - if you have one of those - or maybe some other place where people can ask questions directly or get to cast their votes on what order they'd most like to see certain tasks done.
[QUOTE=ace13;52495896]Don't think of SQLite as a competitor for MySQL, their use cases are wildly different. SQLite is more of a competitor with the c-function fopen(). SQLite even supports opening the database ":memory:" for when you just need to temporarily store arbitrary data in a searchable manner, and it means you don't have to try and deal with global variables or memory management, the query optimizer even means that you don't have to worry about choosing good types or layout for your data. It's actually not that uncommon to run simpler kinds of games with SQLite as the only runtime data store, since that lets you do entity and level management with a well developed query language like SQL. Really, I've seen SQLite used as configuration files, game saves, level data, event logs, action/ability lists, inventory management, object relation tracking, entity-component systems, temporary storage for unloaded cells, and plenty more places. MySQL is the better choice when it comes to storing persistent database entries like account status or money in an RP gamemode, while SQLite is perfect for storing things like undo lists or window positioning in UI.[/QUOTE] Seems reasonable, added it as a new [URL=https://wiki.pragma-engine.com/index.php?title=SQLite]module[/URL]. I'll keep the old MySQL module though, since they do have different uses. • [URL=https://wiki.pragma-engine.com/index.php?title=SQLite]SQLite Module[/URL] • [URL=https://wiki.pragma-engine.com/index.php?title=Sqlite]sqlite[/URL] • [URL=https://wiki.pragma-engine.com/index.php?title=SQLiteConnection]sqlite.Connection[/URL] • [URL=https://wiki.pragma-engine.com/index.php?title=SQLiteStatement]sqlite.Statement[/URL] • [URL=https://wiki.pragma-engine.com/index.php?title=SQLiteValue]sqlite.Value[/URL] • [URL=https://wiki.pragma-engine.com/index.php?title=SQLiteBlob]sqlite.Blob[/URL] Some functions can be used asynchronously using a callback-function. Usage example: [CODE]local r = engine.load_library("wv_sqlite") if(r ~= true) then print("WARNING: An error occured trying to load the 'wv_sqlite' module: ",r) return end local file = ":memory:" -- Database will only exist in RAM local r,con = sqlite.open(file) if(r ~= sqlite.RESULT_OK) then print("Unable to open database: ",sqlite.result_to_string(r)) return end -- Exec always runs synchronously local r = con:Exec([[CREATE TABLE player ( playerid INT AUTO_INCREMENT, name VARCHAR(255), data BLOB );]]) if(r == sqlite.RESULT_OK) then -- PrepareStatement is asynchronous if a function callback is provided, otherwise synchronous con:PrepareStatement("INSERT INTO player(name,data) VALUES(?,?);",function(r,statement) if(r == sqlite.RESULT_OK) then statement:BindText(1,"Silverlan") -- Blob data requires a DataStream local ds = util.DataStream() ds:WriteFloat(32.0) ds:WriteInt32(55) ds:WriteString("Mr. Jackpots") statement:BindBlob(2,ds) -- Executes the statement statement:Step() -- Frees the statement. If this isn't called, the statement will eventually be garbage collected statement:Finalize() -- Statement containing an error r,statement = con:PrepareStatement("SELCT * FROM player;") if(r == sqlite.RESULT_ERROR) then -- Print a description about the SQL error print("SQL Statement Error: ",con:GetResultMessage()) end -- Synchronous statement execution r,statement = con:PrepareStatement("SELECT * FROM player;") if(r == sqlite.RESULT_OK) then local resultId = 1 -- We'll iterate through all found data sets (table rows) while(statement:Step() == sqlite.RESULT_ROW) do print("Result #" .. resultId .. ":") for i=0,statement:GetCount() -1 do -- Number of columns in the set print("Column: ",i +1) print("Column Name: ",statement:GetColumnName(i)) local type = statement:GetType(i) -- The data type for this column in the set print("Type: ",type) if(type == sqlite.TYPE_INTEGER) then print("Value: ",statement:GetInt(i)) elseif(type == sqlite.TYPE_TEXT) then print("Value: ",statement:GetText(i)) elseif(type == sqlite.TYPE_BLOB) then local ds = statement:GetBlob(i) -- Read the blob data we've written previously print("Values: ",ds:ReadFloat(),ds:ReadInt32(),ds:ReadString()) end end resultId = resultId +1 end statement:Finalize() else print("Unable to select data: ",sqlite.result_to_string(r)) end else print("Unable to insert data: ",sqlite.result_to_string(r)) end -- Closes the database connection. If this isn't called, the connection will eventually be garbage collected con:Close() end) else print("Unable to create table: ",sqlite.result_to_string(r)) end [/CODE]
I have become a patron for you! I couldn't do more due to my own finances being messed up but I wanted to show my massive support.
For Patreon, I second what ace13 suggests. People [b]really[/b] love work-in-progress stuff. If you have some stuff that's internal, like a working log of things you plan to do and the order to do them in (like Trello), people really love that stuff. Similarly, if you've got some stuff that's [b]really[/b] raw, stuff that you wouldn't feel comfortable showcasing to the public, then that's prime stuff to show on Patreon. Stuff glitching and bugging is gold material. Things like weekly newsletters, even just a simple report of "This is what I hoped to get done this week; this is what I got done this week; these are the things that came up and caused unexpected delays; this is what I want to get done next week" can go a long way, too. The thing about Patrons is that, in [i]general[/i], they want to support [i]you[/i] as a creator, and not so much [i]your product[/i]. At the same time, though, people are a lot more likely to donate concrete, tiered amounts that you set for them - a "Donate whatever you want" system is often times a bit too liberal for them, and they sort of get tripped up in "how much is enough". By putting out clear-cut tiers - $1, $2, $5, what have you - you take the burden of decision off your Patrons, and they simultaneously feel more comfortable that the amount they donate is enough, since you as a creator explicitly said it is. So giving them a personal vantage, a look behind the curtain and the man running it all, can mean a lot to them. They don't need a fancy new car as a reward - all they really need is some sort of feedback for their patronage. That's my two cents, anyways.
Following this project- wish I had a better understanding of programming, but maybe this will give me an avenue to learn! Thank you for your work on this!
[QUOTE=Smoot;52492534]Space Engineers fan asking for: - Localized physics (aka being able to stand on a ship that's moving fast as fuck) [...][/QUOTE] Done: [video]https://youtu.be/ZXMq2dn3-Mg[/video] Difficult to show on video, so I restricted the object's movement to one axis, but it works just fine with any movement and prop, regardless of linear/angular velocity. Still a little glitchy in some cases, but nothing I can't fix. I'm not sure if I should rotate the camera as well, might be a little disorienting? How does that work in space engineers? [QUOTE=Giginigi;52498596]I have become a patron for you! I couldn't do more due to my own finances being messed up but I wanted to show my massive support.[/QUOTE] Thank you. :) I'll try to set up some patreon rewards soon. [QUOTE=ace13;52495896] When it comes to patreon stuff, perhaps it might be worth doing weekly newsletters or something like that for people who donate? Access to your development trello - if you have one of those - or maybe some other place where people can ask questions directly or get to cast their votes on what order they'd most like to see certain tasks done.[/QUOTE] [QUOTE=Gmod4ever;52498730]For Patreon, I second what ace13 suggests. [...][/QUOTE] Thanks for the tips, that helps a lot!
[QUOTE=Silverlan;52504891]Done: Difficult to show on video, so I restricted the object's movement to one axis, but it works just fine with any movement and prop, regardless of linear/angular velocity. Still a little glitchy in some cases, but nothing I can't fix. I'm not sure if I should rotate the camera as well, might be a little disorienting? How does that work in space engineers? [/QUOTE] The camera should rotate as well. If you apply what I am asking for to some sort of "Space Engineers" type game, you will use this feature inside a ship. It should work like you are standing on the deck of a ship so your feet stay planted (and the view stays static relative to the prop you are standing on). Here is a good example: [media]https://youtu.be/gKF6TerSqlQ?t=13[/media]
[QUOTE=Smoot;52505138]The camera should rotate as well. If you apply what I am asking for to some sort of "Space Engineers" type game, you will use this feature inside a ship. It should work like you are standing on the deck of a ship so your feet stay planted (and the view stays static relative to the prop you are standing on).[/QUOTE] Alright, camera now rotates as well: [T]https://pragma-engine.com/sharex/2017-07-25_23-45-13.gif[/T] I've also added an auto-complete configuration for ZeroBrane for pragma functions and classes: [T]http://sciolyte.com/sharex/2017-07-26_00-00-25.gif[/T] The auto-complete data is generated from the wiki, saves me a lot of manual work.
Sorry, you need to Log In to post a reply to this thread.