Jump to content

Einlander

Members
  • Posts

    778
  • Joined

  • Last visited

Posts posted by Einlander

  1. Or to make it programmatically simple but adventurous:

    Start in a cell where there is just a door, and a high window going outside. Can't open the door, locked. Go inspect high window, bars are loose and one falls off. Pick the bar up, it becomes your first weapon. Inspect the bars again and the player begins hitting the bars breaking it open. When it opens guard comes and opens the door to see what is happening, you need to kill the guard. Player can loot guards body for keys to storage chest where they get their starting items.

  2. Start in a hanging cage. Player needs to run back and forth to make the cage swing towards a wall that has the keys on it.

    Or same idea but you need to swing towards a guard sitting down and sleeping in a chair. Once you have the key you escape and leave the area or kill the guard.

  3. 5 hours ago, St0nedas said:

    The only catch I've found so far, is when setting an entity to use CharacterPhysics, you use SetInput() to control them. Assuming this is the right way to go, how would you send a key press message to the server if the player input is controlled by the engine?

    You simply send the key input and mouse input  to the server as you were thinking. The server does the setinput, gets the new location of the player and sends it to the client.

  4. 1 hour ago, TWahl said:

    Yes they are all powers of two. I have not compressed anything, just saved them as pngs and imported them into leadwerks. I will see what happens if I export as a dds instead...

    I will also post the material as well, when I am back to my computer

    i think he means instead of dxt5, use uncompressed for the texture type. Leadwerks will introduce bad artifacts into your normal map with any type of compression.

    • Upvote 1
  5. Yeah i just found a blog talking about this. http://www.gabrielgambetta.com/client-side-prediction-server-reconciliation.html This will probably need to wait till I have another day off to implement a clientside buffer. The server already has a rolling buffer of 5 frames and 20 world states just because. I knew I would use it one day, but I didn't know it would be this soon. I'm learning all sorts of new things about networking!

  6. 22 hours ago, Rick said:

    Right, so on the client side you can be storing all position updates from the server of all the remote/ghost clients in a queue. Then be tweening between the current position to the next position on the queue. This would give you smooth constant movement. The goal would to be able to keep 2 position items in the queue always while you are popping the current tweening one off it. If you have less than 2 then you know you're lagging because you haven't gotten an update from the server. If you have more than 2 then you know you just got an update from the server because you were lagging. In either cases you can handle it how you see fit. If more than 2 you can skip a couple or increase your tween steps slightly to catch up (but not fast forward like). If you have less than 2 then not much you can do but keep them there OR extrapolate for a couple seconds and fix it when you get packets again.

    From my understanding this is similar to how Source engine does it. It visually lags other remote clients on a client by 50-100ms so that it always has a future position so they can interpolate.

    Just throwing out ideas.

    With regards to player input, the player would be x frames behind the server. Would the server be applying the input to the most recent frame or x - 1 frames?

  7. When I introduce lag, it's not losing packets, so the all get there eventually. So when they get there they are processed. I have it so that every client update loop it reads from the network 10 times unless it is null. This allows it to 'catch up' with the server if it falls behind. There is no real way other than timestamps synced with the server to know if you are falling behind.

    http://einlander.duckdns.org:8000/f/6525b9e505824bbba98f/

    This is a link of how it looks. Right side is the client. I can hold a button and it will not check the network at all. And after 10 seconds iirc it will disconnect from the server. When it starts reading the network messages it has to go through the entire backlog since eNet has reliable messages, and wont drop them.

  8. On 7/26/2017 at 8:30 AM, jen said:

    I suggest you use SteamWorks API for this and check the SteamIDs of players instead.

    I'm want to put this on different indie store-fronts so Steamworks isn't always an option. This also is easily defeated if they have multiple accounts but use the same ip to troll people. Also it helps when a person gets disconnected from a server. In source games, if you have the console enabled you can type 'status' and it will give you the ip address so you can get it later. I do not want the clients to tell each other their ip addresses.

    Also it helps when you are self hosting the server yourself. It would be much easier if it gave you an address thats not 127.0.0.1

     

  9.  

    This is an example using Josh's chat client code.

     
    
    --------------------------------------------------------
    --Function to build user interface on each window
    --------------------------------------------------------
    function BuildGUI(context)
    	local interface = {}
    	interface.gui=GUI:Create(context)
    	interface.root = interface.gui:GetBase()
    	interface.root:SetScript("Scripts/GUI/Panel.lua")
    	interface.chatlog = Widget:TextArea(4,4,interface.root:GetClientSize().x-8,interface.root:GetClientSize().y-30-8,interface.root)
    	interface.textbox = Widget:TextField("",4,interface.root:GetClientSize().y-30,interface.root:GetClientSize().x-8-72-4,26,interface.root)
    	interface.sendbutton = Widget:Button("Send",interface.root:GetClientSize().x-4-72,interface.root:GetClientSize().y-30,72,26,interface.root)
    	return interface
    end
    
    --------------------------------------------------------
    --Initialize client and server
    --------------------------------------------------------
    local MESSAGE_CHAT=1
    local peer = nil
    local port=8888
    local client = Client:Create()
    local server = Server:Create(port)
    local success = client:Connect("127.0.0.1",port)
    
    --------------------------------------------------------
    --Create server interface
    --------------------------------------------------------
    serverwindow=Window:Create("Chat Server",0,0,400,300,Window.Titlebar)
    --servercontext=Context:Create(serverwindow)
    local serverinterface = BuildGUI(serverwindow)
    
    --------------------------------------------------------
    --Create client interface
    --------------------------------------------------------
    clientwindow=Window:Create("Chat Client",300,100,400,300,Window.Titlebar)
    --clientcontext=Context:Create(clientwindow)
    local clientinterface = BuildGUI(clientwindow)
    
    --------------------------------------------------------
    --Main loop
    --------------------------------------------------------
    while true do
    	
    	--------------------------------------------------------
    	--Exit the program
    	--------------------------------------------------------
    	if serverwindow:KeyHit(Key.Escape) or clientwindow:KeyHit(Key.Escape) then return end
    	
    	--------------------------------------------------------
    	--Handle closed windows
    	--------------------------------------------------------
    	if serverwindow:GetHidden()==false then
    		if serverwindow:Closed() then
    			serverwindow:Hide()
    			if clientwindow:Closed() then return end
    			server:Disconnect(peer)
    		end
    	end
    	
    	if clientwindow:GetHidden()==false then
    		if clientwindow:Closed() then
    			clientwindow:Hide()
    			client:Disconnect()
    		end
    	end
    	
    	--------------------------------------------------------
    	--Update client
    	--------------------------------------------------------
    	while true do
    		local message = client:Update()
    		if message==nil then break end
    		
    		if message.id==Message.Connect then
    			clientinterface.chatlog:AddText(">> Connected to server.")
    			
    		elseif message.id==Message.Disconnect then
    			clientinterface.chatlog:AddText(">> Disconnected from server.")
    			
    		elseif message.id==MESSAGE_CHAT then
    			System:Print("Server: "..tostring(message.stream:ReadString()))
    			message.stream:Seek(0)
    			clientinterface.chatlog:AddText("Server: "..tostring(message.stream:ReadString()))
    			
    		end
    		message:Release()
    	end
    	
    	--------------------------------------------------------
    	--Update server
    	--------------------------------------------------------
    	while true do
    		local message = server:Update()
    		if message==nil then break end
    		
    		if message.id==Message.Connect then
    			serverinterface.chatlog:AddText(">> New client connected.")
    			peer = message.peer
    			
    		elseif message.id==Message.Disconnect then
    			serverinterface.chatlog:AddText(">> Client disconnected.")
    			
    		elseif message.id==MESSAGE_CHAT then
    			serverinterface.chatlog:AddText("Client: "..tostring(message.stream:ReadString()))
    			
    		end
    		message:Release()
    	end
    	
    	--------------------------------------------------------
    	--Handle GUI events
    	--------------------------------------------------------
    	while EventQueue:Peek() do
    		local event = EventQueue:Wait()
    		
    		if event.id == Event.WidgetAction then
    			
    			if event.source == clientinterface.sendbutton or event.source==clientinterface.textbox then
    				local s = clientinterface.textbox:GetText()
    				client:Send(MESSAGE_CHAT,s)
    				clientinterface.chatlog:AddText("Me: "..s)
    				clientinterface.textbox:SetText("")
    				clientinterface.gui:SetFocus(clientinterface.textbox)
    			end
    			
    			if event.source == serverinterface.sendbutton or event.source==serverinterface.textbox then
    				local s = serverinterface.textbox:GetText()
    				--server:Send(peer,MESSAGE_CHAT,s)				
    				server:Broadcast(MESSAGE_CHAT,s,0,Message.Reliable)
    				serverinterface.chatlog:AddText("Me: "..s)
    				serverinterface.textbox:SetText("")
    				serverinterface.gui:SetFocus(serverinterface.textbox)
    			end
    		
    		end
    	end
    	
    	--------------------------------------------------------
    	--Refresh both contexts
    	--------------------------------------------------------
    	--servercontext:Sync()
    	--clientcontext:Sync()
    
    end

     

    Ctrl+F Broadcast

    This will work if you send from client to server, but the client will not ever receive data. If the server send no text at all, and you just click send, it will crash.

  10. I have found at least with the server, I need a little more data than I am currently supplied in lua.

    These are some things I would find commands for very helpful.

    • Commands for:
      • How many peers are connected to the server.
      • What are their ip addresses. ipv4/ipv6. Just in case I need to add someone to a ban list for a little bit.
      • Return a list/table of currently connected peers.
      • Disconnect all clients at once.
      • Get the client/servers own external ip address (if possible)
      • Finding out the ip/address of server a client is connected to.
  11. 7 minutes ago, jen said:

    I miss the gallery on top of the forums. That was a cool feature.

    I mean who doesn't like looking at chris.palusak's screenshots for days on end? Shame what he does to the recent queue. I also liked the gallery.

  12. I consider the game launcher to be a workshop extension of the editor. Instead of sharing projects you share games with people who currently have no interest in buying the editor. I would use it more but it simply lacked common usability. I should be able to see what games I already have subscribed to, there should be a page that mirrors the steam page with it's description and screenshots with the option to unsubscribe if possible.

    The problem is that you are giving the option of steam direct as an avenue of exposure, when it is not even an option for 99% of the games in the launcher. I know my game has 'potential', but $100 worth? Nope. The project was a project of love and was always going to be free so there is no way I am spending $100 for a 1 level experiment. Vectronic, that has production value and a goal.

    Every game that is released on steam is not potential exposure for Leadwerks. There are no outward tells that a person is using Leadwerks, and a splash screen is a nicety and not a necessity. Further we have frameworks, mine included that make Leadwerks pass almost for the Source Engine. When releasing through the launcher, you force the audience to know that 'This is made with Leadwerks'. Every game in the launcher is a testament to what Leadwerks can or can't do. In fact The launcher should link back to Leadwerks in some way in passing explicitly encourage the user to make their own version of the game or even a new one.

    The launcher should be able to contribute some statistics for you to use. How often is each game updated, how many players play a specific game, genre or author. This can help you make relevant time sensitive templates. We are on the tail end of the zombie onslaught shooter and entering PvP Battle Royal games. And guess what? We now have networking in Leadwerks. Kind of timely don't you think?

    For all the things I have wrote there is the problem of reality. These things take time to create. Josh is only one person and he has other things he has to do to survive. Hiring another person to do some simpler things costs money so many things will have to wait. If Josh did an gofundme campaign I would donate (it is a donation and not an investment) some money so more things can get done. As long as it goes toward community enhancment or must have things in the game engine.

    TL;DR

    Game launcher is missing many features but It takes time money and manpower to improve.

    • Upvote 1
×
×
  • Create New...