Pragma - A 3D multiplayer sandbox engine with Lua-integration, based on Vulkan and bullet physics
379 replies, posted
[QUOTE=glitchvid;48984339]
Any short-term plans to support other formats for import? Something like obj or fbx that most modern editors can output would be great.[/QUOTE]
I'll add .obj-support to the todo-list, but I can't say yet whether it's going to be just for my model-compiler, or directly ingame.
[QUOTE=TheNerdPest14;48984522]So is there also no limit on entity amount?[/QUOTE]
There are no arbitrary limits, except in a few cases where there was no way around (e.g. there can only be a maximum amount of 8 lights within the player's view at the moment).
[QUOTE=TheNerdPest14;48984522]Also, do you have any support for integrating NPCs?[/QUOTE]
[QUOTE=TheNerdPest14;48984963]Are you going to add anymore support to custom AI?[/QUOTE]
I've started working on some simple AI a while back, so a couple of things are already integrated (Navmeshes, AI schedules and tasks, disposition management, etc.), but it's not usable yet.
This will definitely be a thing however.
[QUOTE=TheNerdPest14;48984522]Also, if I wanted to say, make a map of Europe on that, how much of it would fit with that size you've told me?[/QUOTE]
Well, the minimum/maximum representable numbers with a float range from -340282346638528859811704183484516925440 to 340282346638528859811704183484516925440.
I'm using the same dimensions as valve, so 1 unit equals 0.01905 meters, so the total range is -6482378703463975053310220701819469824 to 6482378703463975053310220701819469824 meters.
In truth you'd run into problems [b]much[/b] sooner than that. The closer you get to the maximum, the higher the imprecision gets, and I'd expect there'd be some other problems as well. Either way, you don't really have to worry about it.
[QUOTE=Kannata;48985027]The launcher keeps crashing for me when I'm updating wtf
[editline]26th October 2015[/editline]
nevermind[/QUOTE]
What was the problem?
Anyway, my priorities for the time being are (In that order):
1) Fixing up the multiplayer
2) Integrating full support for weapons
3) Fixing the physics / Implementing the remaining constraint types / Adding ragdolls
4) Vehicles and AI
5) Everything else
Whether these will actually happen in that order is a different question altogether, so no promises. :)
For reference, the circumference of Earth itself is 40,075,000 meters, so I think a map of Europe would be okay. :v:
[QUOTE=Snickerdoodle;48985148]For reference, the circumference of Earth itself is 40,075,000 meters, so I think a map of Europe would be okay. :v:[/QUOTE]
The practical limit for object placement if a single origin, 32bit floating point system is used is much less than that.
[img]http://i.imgur.com/lBn1mDZ.png[/img]
If my math isn't off (which it very well might be), you'd really start to see flickering somewhere around the 20km mark.
[editline]26th October 2015[/editline]
Granted, Europe map would load (memory issues aside), but things might "jump" visibly due to the lack of precision far enough away from the origin.
This is a cool thing you have going. I'll definitely look into this after I finish the project I'm working on now.
How do I change the resolution? I'm having a problem with the text getting cutoff, and I want to see if changing the resolution will fix it;
[t]http://i.imgur.com/Pw8REBp.png[/t]
[QUOTE=DrPyspy;48991174]How do I change the resolution? I'm having a problem with the text getting cutoff, and I want to see if changing the resolution will fix it;[/QUOTE]
That was a known issue when trying to use fullscreen resolutions, should be fixed in the new update (Just published it).
Let me know if that did the trick, or if it still happens for you.
So will hammer if I try making a map for your engine allow me to build a map the size I want? Like an actual small town?
Again, also, what was your entity limit?
[QUOTE=Silverlan;48995920]That was a known issue when trying to use fullscreen resolutions, should be fixed in the new update (Just published it).
Let me know if that did the trick, or if it still happens for you.[/QUOTE]
My problem was fixed, but a new problem has surfaced. I can't see anything but the sky.
[img]http://i.imgur.com/qzHvrZs.png[/img]
[QUOTE=TheNerdPest14;49018640]So will hammer if I try making a map for your engine allow me to build a map the size I want? Like an actual small town?[/QUOTE]
Yes and no. Hammer complains if you try to [b]load[/b] a map with anything that goes over the grid, but [b]saving[/b] one should work.
I might add support for the source 2 hammer at some point (Which doesn't have that restriction afaik), and I'll definitely create my own map editor, but that's not a priority at the moment.
[QUOTE=TheNerdPest14;49018640]Again, also, what was your entity limit?[/QUOTE]
The absolute limit is 4,294,967,295. Don't worry about it.
[QUOTE=DrPyspy;49019170]My problem was fixed, but a new problem has surfaced. I can't see anything but the sky.[/QUOTE]
That's most likely a driver issue. What's your graphics card? Are your drivers up to date? What does it say when using the "opengl_version" console command? (It should be at least OpenGL 3.3).
Are there any shader errors in the console? (Use the "-console" launch parameter)
[EDITLINE]-[/EDITLINE]
Here's the changelog for october (I'll be posting these monthly to give everyone an idea of what's currently going on):
[CODE]
Version 0.1
31 Oct 2015
- Added env_particle_system spawnflag "Remove on complete" and input "SetContinuous"
- Added Entity:SetParentAttachment and Entity:SetParentBone
- Fixed incorrect rotation order in Entity:LocalToWorld
- Fixed gui.create returning a nil value
- Fixed rare crash when using 'color_random' particle initializer
- Fixed game and entity callbacks not being called in certain cases
30 Oct 2015
- Added BaseEntity:ShouldCollide hook
- Added Entity:EnableCollisions, Entity:DisableCollisions, Entity:SetCollisionsEnabled and Entity:ResetCollisions
- Added several damage types
- Added util.register_class
- Added spanish translations (Thanks, Åftökinitö!)
29 Oct 2015
- Added Entity:GetCollisionCallbacksEnabled, Entity:SetCollisionCallbacksEnabled, Entity:GetCollisionContactReportEnabled and Entity:SetCollisionContactReportEnabled
- Added BaseEntity:CanTrigger, BaseEntity:OnTrigger, BaseEntity:OnStartTouch, BaseEntity:OnEndTouch, BaseEntity:OnContact and BaseEntity:OnTouch hooks
- Added PhysObj:SetCollisionFilter*/GetCollisionFilter*, PhysObj:GetOwner, Entity:RemoveSafely and Entity:SetCollisionFilter*/Entity:GetCollisionFilter*
- Added class "PhysContact"
- Added COLLISIONMASK_DEFAULT
- Fixed spot and point-light shadow maps not updating when their position has changed
28 Oct 2015
- Added GMBase:OnEntityTakeDamage, GMBase:OnEntityTakenDamage, GMBase:OnEntityHealthChanged, GMBase:OnPlayerSpawn and GMBase:OnPlayerDeath
- Added launch parameter "-gamemode <gamemode>"
- Added Player:Respawn
- Added physenv.create_sphere_shape
- Added 2 new overloads for Entity:InitializePhysics
- Fixed crash when trying to load a model with missing materials
- Fixed crash when trying to create a player entity using ents.create
27 Oct 2015
- Fixed texts being cut off when using fullscreen resolution
- Fixed mouse position being interpreted incorrectly in fullscreen windowed mode
- Updated french localizations (Thanks, Gedo789!)
26 Oct 2015
- Added "Player Name" to general game options
- Added Weapon:GetOwner
- Added Weapon:PlayViewActivity
- Added util.fire_bullets
- Fixed various bugs relating to scripted weapons
- Fixed: $origin-parameter does no longer affect attachments when compiling a model
25 Oct 2015
- Added parent flags: FPARENT_PLAYER_VIEW_YAW, FPARENT_SNAP_TO_ORIGIN
- Added Entity:LocalToWorld
- Added new textures: materials/decals/signs, materials/plaster, materials/stone
- Entity:GetAttachment now returns a Quaternion instead of EulerAngles
- The game window is now centered on the screen on startup
24 Oct 2015
- Fixed player entity not getting removed when player disconnects from a server
- Fixed crash after removing a ghost physics object
- Fixed not being able to change the gamemode to anything but the default
- Fixed occasional crash when reloading a map with soundscapes
- Fixed some world geometry not rendering after loading several maps in one session
- Fixed "OnSpawn" being called twice for lua entities
- Fixed $origin parameter having no effect when compiling models
23 Oct 2015
- Added Linux x64 Binaries
- Master server for the server list is now up and running; The server browser can now fetch all active servers
20 Oct 2015
- Added SYSTEM_WINDOWS, SYSTEM_LINUX, SYSTEM_X86 and SYSTEM_X64 lua-constants
19 Oct 2015
- Fixed addons getting unmounted when joining a server
- Added missing DSP effects (scripts/soundfx/fx_generic.txt)
18 Oct 2015
- Public Alpha Release
- Maps can now have an additional .txt-file with the name of the author and a display name for the map
- Fixed scene not rendering correctly if more than one animated mesh is visible at once
- Fixed map not loading when joining a server
- Fixed not being able to connect to servers if the client doesn't support IPv6
- Fixed servers not allowing more than 1 client at a time
- Fixed various issues with scripted entities
- Fixed crash when trying to set the material of a WITexturedShape or WITexturedRect to a non-existing material or texture
- Fixed crash when trying to assign a Mouse Button to an action
- Added french translations (Thanks, Gedo789!)
- Added Entity:IsSpawned lua-binding
17 Oct 2015
- Fixed directional light sources not being rendered correctly on Nvidia cards
- Fixed only one light source being rendered when multiple light sources are within the view frustum
- Added launch parameter -gldebug and convar debug_opengl_enabled for additional OpenGL Debug Information
16 Oct 2015
- Fixed animated models being rendered incorrectly on Nvidia cards
15 Oct 2015
- Shader linker errors now display correct lines and include files
- Shader errors now display the actual lines of code where the error occurred
- Fixed keybinds being overwritten by mouse buttons after changing them in the controls menu (Thanks, orenii~!)
- Fixed shader errors on Nvidia cards
14 Oct 2015
- Fixed GUI and skybox shaders on Nvidia cards
- Fixed displacements with multiple textures (alpha-transitioning) only showing main texture
13 Oct 2015
- Fixed various shader issues on Nvidia cards
- Fixed crash when lua errors occurred within class functions called by the engine
- Fixed distanced meshes being rendered completely in shadow when environmental light sources are used
- Soundscapes now only play if they're in line of sight of the player
12 Oct 2015
- Fixed shader program link log warnings not displaying in the console properly
- Fixed log-commands not working
- Fixed gaussian blur shadows on Nvidia cards
- Shader errors now display the correct lines and respective include files, if the #include-directive was used
11 Oct 2015
- Added map 'test_movement'
- Fixed positioning of first-person legs
- Updated fx_footsteps.txt to new soundscript format
10 Oct 2015
- Added point_constraint_fixed, point_constraint_ballsocket and point_constraint_hinge entities
- Added logic_relay entity
- Added maps 'test_constraints', 'test_lights', 'test_sound_dsp' and 'test_particles'
- Added partile systems: fire, explosion, smoke, weather, water
- Fixed gaussian blur shader not working for Nvidia and Intel cards
- Fully implemented env_particle_system entity
09 Oct 2015
- Added MySQL Module
- Added missing binaries
07 Oct 2015
- Private Alpha Release[/CODE]
I'm still working on the weapon system at the moment, but it's coming along nicely.
After that I'm planning on implementing some basic vehicle physics, I should be able to get both ready within the next 2 weeks.
[URL=http://sciolyte.com/sharex/2015-10-31_22-49-24.png][IMG]http://sciolyte.com/sharex/2015-10-31_22-49-24_t.jpg[/IMG][/URL]
It would be really amazing if someone eventually copied a sandboxy game like garrys mod in this engine.
I'm still enjoying engine error 87 :(
I was thinking of at point after I finish this game I'm working of like trying to make some huge sandbox thing on your game like DarkRP or something. Is there any tangible player limit for your game currently? Or means of saving player data?
[QUOTE=shadowboy303;49028882]I'm still enjoying engine error 87 :([/QUOTE]
I'd love to help, but I can only guess what's going on. I found [URL=https://youtu.be/-ml1UaxKZig]this video[/URL] with a solution which supposedly solved this error in various different programs for a bunch of people, you can try it, but I have no idea if it'll actually help.
[QUOTE=TheNerdPest14;49029967]I was thinking of at point after I finish this game I'm working of like trying to make some huge sandbox thing on your game like DarkRP or something. Is there any tangible player limit for your game currently? Or means of saving player data?[/QUOTE]
I can't make a statement on the player limit yet, there's still a couple of multiplayer-bugs I've yet to resolve and the net-code needs some improving.
As for saving player data, you could just use the [URL=http://wiki.sciolyte.com/index.php?title=Mysql]mysql[/URL] (Requires your own MySQL server) or [URL=http://wiki.sciolyte.com/index.php?title=Lib_file]file[/URL] library.
[QUOTE=Silverlan;49034346]I'd love to help, but I can only guess what's going on. I found [URL=https://youtu.be/-ml1UaxKZig]this video[/URL] with a solution which supposedly solved this error in various different programs for a bunch of people, you can try it, but I have no idea if it'll actually help.
I can't make a statement on the player limit yet, there's still a couple of multiplayer-bugs I've yet to resolve and the net-code needs some improving.
As for saving player data, you could just use the [URL=http://wiki.sciolyte.com/index.php?title=Mysql]mysql[/URL] (Requires your own MySQL server) or [URL=http://wiki.sciolyte.com/index.php?title=Lib_file]file[/URL] library.[/QUOTE]
I'm going to start checking this out. I hope I can make a super huge map with hammer on this, bigger than anything on GMod hopefully.
There's now full .smd-support for the model compiler, meaning you don't need 3ds max anymore to actually be able to compile models for sciolyte!
That took a bit longer to implement than expected, so progress was a bit slow the past week. I should be able to get back on track now and finish the weapon system some time this or next week.
This is pretty interesting!
Would it be legal to make a commercially-sold game with this engine?
While it may not be of the highest priority, any chance of getting the launcher to download multiple files at a time added to the to-do list?
Since this runs through OpenGL, will there be any hope for custom GLSL shaders?
I'd like to imagine them being able to be pakratted directly into a map, allowing for mappers to add all sorts of crazy effects, like these:
[video=youtube;JpksyojwqzE]https://www.youtube.com/watch?v=JpksyojwqzE[/video]
[QUOTE=AnonymaPizza;49092552]Would it be legal to make a commercially-sold game with this engine?[/QUOTE]
I think it's a bit too early for anything on that scale.
I'm fine with people selling their own content for the game, as long as none of the game-files are included anywhere.
[QUOTE=FrankPetrov;49094259]While it may not be of the highest priority, any chance of getting the launcher to download multiple files at a time added to the to-do list?[/QUOTE]
I might push the file decompression onto a different thread, so it can start downloading the next file right away instead of having to wait, but it really isn't a priority right now.
[QUOTE=AnonymaPizza;49097186]Since this runs through OpenGL, will there be any hope for custom GLSL shaders?
I'd like to imagine them being able to be pakratted directly into a map, allowing for mappers to add all sorts of crazy effects, like these:
[video=youtube;JpksyojwqzE]https://www.youtube.com/watch?v=JpksyojwqzE[/video][/QUOTE]
Can't watch the video, blocked in my country.
Anyway, you can already do that. All of the default shaders are located in the "shaders" directory. You can modify them in any way you want and just place your new version inside your gamemode/addon (In which case they will take priority over the default ones), or write your own shaders entirely.
Creating a new shader requires an additional lua-script, which gives you a bit more control over the actual rendering process. Or you can just go all-out and just use the [URL=http://wiki.sciolyte.com/index.php?title=Opengl]opengl functions[/URL] directly.
There aren't any tutorials or examples for any of that yet, but I'll make sure to add some soon.
Having too much fun with this
[img]http://puu.sh/lqnBV/d4ef29b699.jpg[/img]
Have a flyable goat drone :v:
Is it hard to compile models for this? What kind of scale does it use for models? Is one unit for a model one meter in-game?
[QUOTE=TheNerdPest14;49141967]Is it hard to compile models for this? What kind of scale does it use for models? Is one unit for a model one meter in-game?[/QUOTE]
I'm using the [URL=https://developer.valvesoftware.com/wiki/Dimensions#Source_Engine_Scale_Calculations]same dimensions as the source engine[/URL]. Even if the scale should be wrong, you can just use the $scale-option when compiling the models.
As for the compilation, it's pretty straight forward and also very similar to how it works in source. You need to create a '.wai'-file (Similar to the '.qc'-file in source), which looks [URL=http://pastebin.com/c3sTts5X]something like this[/URL].
Then you just need to drag and drop the '.wai'-file onto '<sciolyte>/bin/wmc.exe', and it'll generate a '.wmd'-file in the same directory where the '.wai' is located. That's your model, which you can place anywhere in the '<sciolyte>/models' directory.
If you're using 3ds max, you can also use the exporter scripts located in '<sciolyte>/sdk/maxscript' and use the exported files instead of smds.
To test ingame if your model works properly, you can just use something like:
[code]
local ent = ents.create("prop_physics")
if(ent ~= nil) then
ent:SetModel("player.wmd") // No need to add "models/" to the path
local pl = ents.get_players()[1]
ent:SetPos(pl:GetPos() +pl:GetForward() *80 +pl:GetUp() *100)
ent:Spawn()
ent:DropToFloor()
end
[/code]
[img]http://puu.sh/luXuC/d54dd6ca11.jpg[/img]
first scripted vehicle for this engine :v: poor silverlan never gets to rest with me around
Small progress update.
There's still a bunch of stuff left to do on the weapon and vehicle systems, but here's a small preview:
[video]https://youtu.be/SDwbsbDWB_0[/video]
I didn't have a whole lot of time to work on the engine this month, so I didn't get quite as much done as I had planned.
Either way, here's the changelog for this month so far:
[CODE]
Sciolyte ChangeLog
Version 0.1
28 Nov 2015
- Added Entity:IsShared, Entity:IsSynchronized, Entity:SetSynchronized, Vehicle:GetFirstPersonCameraOffset, Vehicle:SetFirstPersonCameraOffset, Vehicle:GetSteeringWheel and Vehicle:SetSteeringWheelModel
- Added prop_dynamic entity
- Physics are now interpolated between ticks
- Fixed parent data not being transmitted to a client if it was set before the entity was spawned
- Fixed Player:SetObserverMode not being transmitted to the client when called serverside
- Fixed env_camera not being updated every frame
27 Nov 2015
- Added Vehicle:GetSpeedKmh, Vehicle:GetEngineForce, Vehicle:GetBrakeForce, Vehicle:GetMaxEngineForce, Vehicle:GetMaxReverseEngineForce, Vehicle:GetMaxBrakeForce, Vehicle:SetEngineForce, Vehicle:SetBrakeForce, Vehicle:SetMaxEngineForce, Vehicle:SetMaxReverseEngineForce, Vehicle:SetMaxBrakeForce, Vehicle:GetMaxDampingRelaxation, Vehicle:SetMaxDampingRelaxation, Vehicle:GetAcceleration, Vehicle:SetAcceleration, Vehicle:GetTurnSpeed, Vehicle:SetTurnSpeed, Vehicle:GetMaxTurnAngle, Vehicle:SetMaxTurnAngle, VHCWheel:GetMaxDampingRelaxation, VHCWheel:SetMaxDampingRelaxation, VHCWheel:GetRelativeSuspensionSpeed, VHCWheel:GetSuspensionForce, VHCWheel:GetSkidGrip, VHCWheel:GetContactNormal, VHCWheel:GetContactPoint, VHCWheel:IsInContact, VHCWheel:GetSuspensionLength, VHCWheel:GetWorldSpaceWheelAxle, VHCWheel:GetWorldSpaceWheelDirection and VHCWheel:GetGroundObject
26 Nov 2015
- Added VHCWheel class
- Added Vehicle:AddWheel, Vehicle:GetWheelCount, Vehicle:GetWheels, Vehicle:GetWheel, Vehicle:GetFrictionSlip, Vehicle:SetFrictionSlip, Vehicle:GetMaxSuspensionCompression, Vehicle:SetMaxSuspensionCompression, Vehicle:GetMaxSuspensionLength, Vehicle:SetMaxSuspensionLength, Vehicle:GetRollInfluence, Vehicle:SetRollInfluence, Vehicle:GetSteeringAngle, Vehicle:SetSteeringAngle, Vehicle:GetSuspensionStiffness, Vehicle:SetSuspensionStiffness, Vehicle:GetWheelDampingCompression, Vehicle:SetWheelDampingCompression, Vehicle:GetWheelDirection, Vehicle:SetWheelDirection, Vehicle:GetWheelRadius, Vehicle:SetWheelRadius
- Fully implemented vehicle system
- Fixed ent_create and ent_remove console commands not working
- Fixed 'print'-functions only printing an entity's address
23 Nov 2015
- Added Addon Package Composer/Extractor (wpd.exe)
- Fixed model names with less than 4 characters crashing the model compiler
22 Nov 2015
- Added new overload for PhysRigidBody:ApplyForce
- Added PhysRigidBody:ApplyImpulse, PhysRigidBody:ApplyTorque, PhysRigidBody:ApplyTorqueImpulse, PhysRigidBody:ClearForces, PhysRigidBody:GetTotalForce, PhysRigidBody:GetTotalTorque
- Added PhysObj:ApplyForce, PhysObj:ApplyImpulse, PhysObj:ApplyTorque, PhysObj:ApplyTorqueImpulse, PhysObj:ClearForces, PhysObj:GetTotalForce, PhysObj:GetTotalTorque
- Fixed CalcView-hook ignoring changes to the camera position and rotation
21 Nov 2015
- Added Player:DropActiveWeapon
- Added console command "drop"
20 Nov 2015
- Added game callbacks: "OnCharInput", "OnKeyboardInput", "OnMouseInput" and "OnScrollInput"
- Added math.approach, BaseEntity:SendNetEvent BaseEntity:ReceiveNetEvent and util.shake_screen
- Fixed weapon clip sizes not being synchronized between server and client when a weapon is created
19 Nov 2015
- Added util.get_faded_time_factor, util.get_scale_factor and math.clamp
- Fixed Entity:GetCollisionBounds not returning the correct bounds
18 Nov 2015
- Added matrix.create_from_axes, engine.get_tick_count, PhysObj:SetDamping, PhysObj:SetLinearDamping, PhysObj:SetAngularDamping, PhysObj:GetLinearDamping, PhysObj:GetAngularDamping, PhysRigidBody:SetDamping, PhysRigidBody:SetLinearDamping, PhysRigidBody:SetAngularDamping, PhysRigidBody:GetLinearDamping and PhysRigidBody:GetAngularDamping
- Fixed entities parented with FPARENT_PLAYER_VIEW or FPARENT_PLAYER_VIEW_YAW flags not moving with the player's camera in some cases
- Fixed Quaternion:ToMatrix and Mat4:ToQuaternion returning incorrect values
16 Nov 2015
- Added ents.find_in_cone
- Implemented smoothing for particle effects
- Fixed child-particles not moving with their parents
15 Nov 2015
- Added Entity:RemoveEntityOnRemoval, Entity:GetLocalAngularVelocity, Entity:SetLocalAngularVelocity and Entity:AddLocalAngularVelocity
- Added player callback "OnActionInput" and entity callbacks "OnHealthChanged", "OnRemove" and "OnSoundCreated"
- Added util.splash_damage
- Changed default gravity to "0 -600 0"
- print, msg, msgn and print_table now print the actual values of the arguments instead of the types
- Fixed gravity affecting characters/players too much
- Fixed game.raycast filter being ignored in certain cases
14 Nov 2015
- Collision meshes with a lot of vertices are now automatically split into smaller convex meshes when compiling models. This behavior can be disabled (or forced) by specifying "decompose 0/1" in the $collisionmesh-definition
- Fixed collision meshes with multiple shapes falling apart
13 Nov 2015
- Added game.register_ammo_type, game.get_ammo_type_id, game.get_ammo_type_name, Weapon:GetPrimaryAmmoType, Weapon:GetSecondaryAmmoType, Weapon:HasPrimaryAmmo, Weapon:HasSecondaryAmmo, Weapon:IsPrimaryClipEmpty, Weapon:IsSecondaryClipEmpty, Weapon:HasAmmo, Weapon:GetPrimaryClipSize, Weapon:GetSecondaryClipSize, Weapon:GetMaxPrimaryClipSize, Weapon:GetMaxSecondaryClipSize, Weapon:SetPrimaryClipSize, Weapon:SetSecondaryClipSize, Weapon:SetMaxPrimaryClipSize, Weapon:SetMaxSecondaryClipSize, Weapon:AddPrimaryClip, Weapon:AddSecondaryClip, Weapon:RefillPrimaryClip, Weapon:RefillSecondaryClip, Weapon:RemovePrimaryClip, Weapon:RemoveSecondaryClip, Weapon:SetPrimaryAmmoType, Weapon:SetSecondaryAmmoType, Player:GetAmmoCount and Player:SetAmmoCount
- Added "+attack3" and "+attack4" console commands
- Added BaseWeapon:TertiaryAttack, BaseWeapon:Attack4, BaseWeapon:TranslateViewActivity and BaseEntity:TranslateActivity hooks
- Fixed Player:GetWeapons returning a nil value
- Fixed crash when calling Player:DeployWeapon
12 Nov 2015
- Added BaseEntity:HandleAnimationEvent and Weapon:HandleViewModelAnimationEvent hooks
- Added Weapon:SetNextPrimaryAttack, Weapon:SetNextSecondaryAttack, Weapon:SetNextAttack, Weapon:SetAutomaticPrimary, Weapon:SetAutomaticSecondary, Weapon:IsAutomaticPrimary and Weapon:IsAutomaticSecondary
- Added support for custom activity and animation event names when compiling models
- ents.register now overrides any previous class registration
- Fixed crash in model compiler when trying to use a collision mesh without a parent bone
- Fixed entity rotations resetting to identity when entity physics are initialized
11 Nov 2015
- Fixed untextured triangles in .smds causing meshes to be parsed incorrectly in the model compiler
- Fixed two lines being read instead of one when using File:ReadLine on an empty line
10 Nov 2015
- Added .smd-support for meshes, animations and collision meshes for the model compiler
- ` does no longer close the console if it is open
- Entity movetype is now automatically set to MOVETYPE_PHYSICS when dynamic physics are initialized, or MOVETYPE_NONE for static physics
- env_camera entity now accepts inputs clientside
08 Nov 2015
- Added new overload for Mat4:Rotate
07 Nov 2015
- Added Mat4:Decompose
- Added new overload for Vector:Rotate
- Fixed Mat4:Rotate, Vector:Rotate and EulerAngles:ToMatrix expecting radians instead of degrees
02 Nov 2015
- Model compiler command "$scale" does no longer affect attachments
[/CODE]
This looks really fucking cool. Good work and good luck to all of you working on it.
So, I thought it might be a good idea if I create some small test-scripts from time to time and show the code here, as an insight on how things work.
E.g. here's an example script on how to render GUI-elements (or anything 2D-related for that matter) on a 3D-surface:
[video]https://youtu.be/sIbWv5zWuyQ[/video]
[CODE]
local textureSize = Vector2(512,512) -- Resolution for our texture
local clearColor = Color(0,255,0,255) -- Background color
-- Create the OpenGL Texture
local glTex = GLTexture.Create(textureSize.x,textureSize.y,GL_RG B,GL_RGB,GL_UNSIGNED_BYTE)
-- Assign it to the target game-texture
local tex = engine.create_texture("test_gui_texture",glTex)
-- Create the frame buffer object (Required to be able to draw to the OpenGL Texture)
local glFbo = GLFrameBuffer.Create(glTex)
-- Create the actual material and assign the texture to it
local mat = engine.create_material(
"test_gui_material", -- The material name. Has to be the same as the surface where the texture should be drawn
"textured" -- The shader to use
)
mat:SetTexture("diffusemap",tex)
local el = gui.get_chat_box() -- The element to draw to the texture
local origin = Vector2(0,0) -- Local offset of the GUI Element
local defaultClearColor = Color(0,0,0,255)
local cb = game.add_callback("Render",function()
glFbo:Bind() -- Everything after this will be rendered into the texture attached to this frame buffer
local w,h = opengl.get_view_port_size() -- We have to reset the view port once we're done rendering
opengl.set_view_port(0,0,textureSize.x,textureSize .y)
opengl.set_clear_color(clearColor)
-- We want to re-render the texture every frame, so we have to clear the contents from the last frame
opengl.clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
opengl.enable(GL_BLEND) -- Required for text rendering
opengl.set_blend_func(GL_SRC_ALPHA,GL_ONE_MINUS_SR C_ALPHA)
-- Render the element, as well as all its children
el:Render(origin,textureSize)
opengl.disable(GL_BLEND);
glFbo:Unbind() -- Unbind it, to make sure it's not being manipulated after this point
opengl.set_clear_color(defaultClearColor) -- Reset the clear color
opengl.set_view_port(0,0,w,h) -- Reset the viewport
end)
[/CODE]
If there's interest, I'll start doing more of these.
I'm open to suggestions, so if anyone wants to see something specific, let me know and I'll whip something up!
Small status update:
Development on the engine is currently on hold until february due to exams, however I'll have a lot more time on my hands after that and should be able to publish updates at the same rate as before.
However, I've finally finished the [url=http://mods.sciolyte.com]Modding Hub[/url]! (Please excuse the shitty design, I'm not a designer, so I just grabbed a free template for now.)
It's still empty, since there are no uploads yet, however the site is fully functional.
To upload content, you need an account, which you can create using the [url=http://mods.sciolyte.com/index.php?mode=register]registration form[/url], or by [url=http://mods.sciolyte.com/index.php?mode=login]logging in[/url] with your steam account (In which case a new account will be created automatically.).
You don't need an account to be able to download content.
Merry christmas everyone. :)
Merry Christmas!
The example code you have provided shows that it would be really streamlined to create scripts on this engine so I'm looking forward to working with it.
I'd really like to support this project aswell, so do you accept donations in any form?
[QUOTE=bizzclaw;49393058]I'd really like to support this project aswell, so do you accept donations in any form?[/QUOTE]
Thanks. The server's pretty expensive, so I can definitely need any support I can get. :)
I've added a [url=http://mods.sciolyte.com/index.php?mode=donate]donation button[/url] to the websites.
I've also just wrote a small [url=http://wiki.sciolyte.com/index.php?title=Tutorial_php_queries]PHP wrapper library[/url], which can be used to retrieve a list of servers from the master server, and ping individual servers (Pinging doesn't work yet, since I don't have access to the up-to-date engine code right now. I'll make sure to add that as soon as I can.).
Here's a usage example:
[code]
<?php
require_once("sci_query.php");
try
{
// Send the query to the master server. See the descriptions in the 'SciRequestFilter'-class for more information about the filters.
// 'RequestServers' returns an array of 'SciServerData'-objects.
$servers = SciQuery::RequestServers(SciRequestFilter::F_NOT_FULL | SciRequestFilter::F_NO_PASSWORD,array(
"hostname" => "Sci*yt", // All servers that match "*sci*yt*" (e.g. "Sciolyte"), case doesn't matter
"map" => "fork",
"gamemode" => "deathmatch",
"version" => "1"
));
for($i=0;$i<count($servers);$i++)
{
$sv = $servers[$i];
echo "#" . $i . " - " . $sv->name . "<br/>";
echo "IP: " . $sv->ip . "<br/>";
echo "Engine Version: " . $sv->engineVersion . "<br/>";
echo "Port: " . $sv->port . "<br/>";
echo "Players: " . $sv->players . "/" . $sv->maxPlayers . "<br/>";
echo "Bots: " . $sv->bots . "<br/>";
echo "Map: " . $sv->map . "<br/>";
echo "Game Mode: " . $sv->gameMode . "<br/>";
echo "Password Protected: " . (($sv->password === true) ? "Yes" : "No") . "<br/>";
echo "<br/>";
}
}
catch(Exception $e)
{
echo "Unable to retrieve server list: " . $e->getMessage() . "<br/>";
}
?>
[/code]
I know I've said there wouldn't be any updates until february, but I was bored today, so I've whipped up a small socket library.
Runs non-blocking/asynchronous, TCP and UDP supported, could be used for cross-server data exchange/chats, grabbing/sending data to/from websites, etc.
[b]HTTP GET-Request Example:[/b]
[code]
local r = engine.load_library("socket/wv_socket")
if(r ~= true) then
print("WARNING: An error occured trying to load the 'wv_socket' module: ",r)
return
end
function http_get(host,target,callback,timeout)
timeout = timeout or 0
local function read_content(socket,callback,content)
content = content or ""
socket:ReceiveAtLeast(1,function(err,packet) -- Read the next batch; 'err' will be SOCKET_ERROR_EOF when all data has been read
if(err:IsError() == true) then
socket:Close()
if(err:GetValue() ~= SOCKET_ERROR_EOF) then
callback(err)
return
end
callback(err,content)
return
end
local n = packet:ReadString()
content = content .. n
read_content(socket,callback,content) -- Keep reading
end)
end
net.resolve(SOCKET_PROTOCOL_TCP,host,"http",function(err,ep) -- Resolve the address into an endpoint (ip +port)
if(err:IsError() == true) then
callback(err)
return
end
local socket = net.create_socket(SOCKET_PROTOCOL_TCP)
socket:SetTimeoutDuration(timeout)
socket:Connect(ep,function(err) -- Connect to the webserver
if(err:IsError() == true) then
socket:Close()
callback(err)
return
end
local request = NetPacket()
request:WriteString( -- Header for a GET-request
"GET " .. target .. " HTTP/1.0\r\n" ..
"Host: " .. host .. "\r\n" ..
"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)\r\n" ..
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n" ..
"Accept-Language: en-us,en;q=0.5\r\n" ..
"Accept-Encoding: gzip,deflate\r\n" ..
"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n" ..
"Keep-Alive: 300\r\n" ..
"Connection: keep-alive\r\n" ..
"Pragma: no-cache\r\n" ..
"Cache-Control: no-cache\r\n" ..
"\r\n"
)
socket:Send(request,function(err) -- Send the header
if(err:IsError() == true) then
socket:Close()
callback(err)
return
end
socket:ReceiveUntil("\r\n",function(err,packet) -- Receive the first line of the response, which contains status information
if(err:IsError() == true) then
socket:Close()
callback(err)
return
end
local str = packet:ReadString()
local data = str:split(" ")
if(#data >= 3) then
local httpVersion = data[1] or ""
local statusCode = tonumber(data[2] or "")
local statusMessage = data[3] or ""
if(httpVersion:sub(0,5) ~= "HTTP/") then
socket:Close()
callback(ErrorCode("Invalid response",-1))
elseif(statusCode ~= 200) then
socket:Close()
callback(ErrorCode("Invalid status code " .. statusCode,-1))
else
socket:ReceiveUntil("\r\n\r\n",function(err,packet) -- Read the rest of the response header
if(err:IsError() == true) then
socket:Close()
callback(err)
return
end
-- local headers = packet:ReadString()
-- headers = headers:split("\r\n")
-- local contentLength = -1
-- for _,h in ipairs(headers) do
-- if(h:sub(0,16) == "Content-Length: ") then
-- contentLength = tonumber(h:sub(17))
-- break
-- end
-- end]]
read_content(socket,callback) -- Start reading the website content
end)
end
else
socket:Close()
callback(ErrorCode("Invalid response",-1))
end
end)
end)
end)
end)
end
[/code]
[code]
http_get("htmlandcssbook.com","/about/",function(err,content)
msgn("Result: ",err)
if(err:IsError() == false or err:GetValue() == SOCKET_ERROR_EOF) then
local f = file.open("data/out.html","w")
if(f ~= nil) then
f:WriteString(content) -- Write the html code to our file
f:Close()
end
end
end)
[/code]
More information [URL=http://wiki.sciolyte.com/index.php?title=Socket]here[/URL].
Sorry, you need to Log In to post a reply to this thread.