Updates to Battle Farm, July 26 2017


So I made some changes to the dev version (see below) and BAM, the file stopped working. As far as I can tell, it wasn't any one specific thing, it was that the game does too much logic to set itself up at the beginning. So I spent a few hours changing it so that the code generates what I need in Studio, and then I copy/paste that into the workspace so that it's already there for the client version. An extra step, and it adds to the upfront load time, but I am hoping that it will also reduce the lag in general to have it done.

User Experience Improvements

  • Cost of Robux purchases now WAY cheaper! Thanks for the support as always :)
  • An issue with surface guis forced me to redo how the watering/fertilizing works. So glad it did - I think the new way is much better.
  • Non-essential buildings now spawn in after the world is done loading the essential things. This lets the players get to loading before the client has to load in all its extra stuff.

You can play Battle Farm HERE. Thanks for playing!

Updates to Battle Farm, July 13 2017


New Features

  • Water buttons next to each plant - you step on it, it waters the plant. Much easier than using gui! Right now only the plant owner can trigger it but I might change it so that if anyone steps on it the plant gets watered. Will do something similar for refertilizing next.

User Experience Improvements

  • Chance of gold drops about twice what it was before. Still uses (likes / dislikes) * multiplier - just made the multiplier higher.

Bugs Fixed

  • Still working on lag. Every little bit helps ... I hope
  • Monsters seem to get scarce after a while - put a small fix in for that, will keep an eye on it.

You can play Battle Farm HERE. Thanks for playing!

Updates to Battle Farm, July 05 2017


I rushed out some 4th of July features (fireworks that gave coins) that only sort of half worked and were seriously OP due to a bug. So - those are disabled for now but will be back, and working better, at the next holiday.

New Features

  • Player banners for house that indicate player level, group rank (if in derangedokapi group) and prestige level (which right now is 1 for everyone until I get that bit written).

User Experience Improvements

  • Various lag fixes in place including: fewer monsters, slower tree times (they still give the same amount per second, they just do it every 5 seconds), more efficient drop spawn timing, better departed player cleanup.
  • Starter gifts are now automatically given (except some of the seeds) rather than sent to the mailbox. This way players start with some money and gold.
  • After you kill a monster it shouldn't be able to continue to inflict damage, unless it's huge and it just crushes you when it falls.
  • Moved things around in the town square to make it easier to find.
  • Trees are more generous! Game balance fix for lower level players.
  • If the game is having trouble saving, it now sends you a message in the message center to let you know.
  • The conveyor was having too many lag issues, so I changed it to a plant that gives coin. Not as fun to watch, but far less laggy (I HOPE).

You can play Battle Farm HERE. Thanks for playing!

Updates to Battle Farm, July 01 2017


Still working on lag. Frustrated. But super excited about the houses coming back! Bumped it up a major version since this is pretty big!

New Features

  • HOUSES WITH COIN CONVEYORS! There's going to be a lot more to these, but this will get us started.

User Experience Improvements

  • Fixed some game balance issues: all trees give more coins - especially the Mega Trees which can now earn you Trillions/second. Generous Trees cost less.

You can play Battle Farm HERE. Thanks for playing!

Updates to Battle Farm, June 27 2017


New Features

  • Slingshots are now upgradeable!
  • Weapon upgrades happen through the weapon choice GUI now, not the building floors.
  • New cow barn created by user HammerOfDarkness!

User Experience Improvements

  • Optimized the way I'm updating trees every second. Also makes them a little harder to hack into.
  • Reduced the number of monsters that can be on the field at any given time.
  • For now, have limited player count to 3 until I can get the EVER PRESENT lag issue under control. I am hoping to set it back to 4 someday soon.
  • Enemies now actually drop the items you won onto the field.

Bugs Fixed

  • If a user changed names, their old name and score would stay on the leaderboard. Fixed. This also wiped out the leaderboards but they'll be back.
  • High Yield coin trees were giving WAY too few coins due to some faulty math. Fixed!
  • When you respawn, you get to keep your max hp (it was resetting to 100 before).

You can play Battle Farm HERE. Thanks for playing!

Updates to Battle Farm, June 26 2017


Every time I publish a big change and then advertise I find some huge hideous bug that can only be revealed by real players playing it the real way, in groups. Every. Time. I do test with the studio testing tools but they're just not the same.

Bugs Fixed

  • There was an issue when a mobile device left the game by just closing the app (rather than leaving) their tycoon and data stayed in the game as a ghost, which caused there to not be enough tycoons for new players, and also created a LOT of lag over time. It's hard for me to reproduce but I put in some safeguards to check that tycoon owners are actually in the game.

User Experience Improvements

  • Increased chances of finding a boost on the ground

You can play Battle Farm HERE. Thanks for playing!

Updates to Battle Farm, June 25 2017


I spent some time away from Battle Farm to work on Scavenge. It gave me time to think through a few issues - mostly that the game balance and general FUN were way off. Also, there were some big issues with planting - namely it was difficult and frustrating. So I made some pretty fundamental changes to how you plant, how you see your inventory, and what a typical session of gameplay entails. Also got some model help from player JenryTheGhost!

New Features

  • Plants have their own stats now: you can fertilize them to boost their output, you can water them to keep them producing, and like real plants they do eventually age and die.
  • Plants now give each second rather than once every x seconds. This means they give less, but more frequently. It also means:
  • No more Quick Trees. These are now "Generous Trees" which are a mid-range price and higher output.

User Experience Improvements

  • Since the last iteration seems to have addressed the slow game problems, I've set the auto-save back to every 15 seconds and have removed the autosave warning at the start. You can still manually save your game if you want before you leave, just to be sure you keep everything up to the second.
  • Totally new way to manage inventory and plant plants. Trees planted into mounds of dirt on the ground. No more being told you can't plant somewhere! No more shovel tool, either.
  • No more plant store - all done through planting GUI now.

You can play Battle Farm HERE. Thanks for playing!

LocalScripts stop working after SurfaceGui assigned to same adornee twice #RobloxDev

So here’s the problem I found (solution below, too 🙂 )

I have trees in Battle Farm that are managed through a series of SurfaceGuis (with buttons to plant, cut down, etc). The Guis are in the player.PlayerGui (since the buttons use LocalScripts) and assigned an Adornee called “Readout”, which is an invisible brick wrapped around the tree trunk:

When there is no tree planted in the spot, that SAME Readout brick has a SurfaceGui that says “Click to Plant”:

And when I first load each tree, they work fine.

HOWEVER – if you

  1. Click to plant a tree (GUI 1)
  2. THEN click the “water” button ON THAT SAME TREE (GUI 2)  after it’s planted,
  3. Nothing happens. In a gui that if loaded first (loading a planted tree) works fine.

I tried a lot of things:

  1. Deleting any SurfaceGuis from player.PlayerGui with the Readout assigned as Adornee using Destroy()
  2. Trying the same but using game.Debris:AddItem(gui,0)
  3. Testing for script Disabled, Zindex, etc etc

Ultimately, here’s what worked:

Before swapping out the GUI, I first cloned the readout part, destroyed the old readout part and assigned the GUI to the new (identical) readout part. Lots of extra overhead but it was the only way I could find to fix it.

function tycooncontrol.applyDecalToTreeReadout(player, orig_readout_part, planted_or_unplanted)
	-- first we're going to try deleting and redoing the readout part
	for _, gui in pairs(player.PlayerGui:GetChildren()) do
		if gui.ClassName == "SurfaceGui" and gui.Adornee == orig_readout_part then
			gui:Destroy() -- destoying any guis attached to the current readout part
	orig_readout_part.CanCollide = false
	local readout_part = orig_readout_part:Clone()
	readout_part.Parent = orig_readout_part.Parent

FilteringEnabled and StarterGui #RobloxDev

One of the many “opportunities for improvement” about FilteringEnabled is that some things will appear to work in Studio but not on the client, which means you can’t trust what you see when you press play in Studio.

A big one is that anything you place in StarterGui replicates to the PlayerGui just fine in studio run mode, but not once you publish it and play it on the client.

So, I always have a script on my PlayerAdded that loops through the guis in StarterGui and replicates them to the player gui, if they’re not there already.

-- put this inside your PlayerAdded function
repeat wait() until player:FindFirstChild("PlayerGui")
for _, gui in pairs(game.StarterGui:GetChildren()) do
     if not player.PlayerGui:FindFirstChild(gui.Name) then
          local g = gui:Clone()
          g.Parent = player.PlayerGui

To be honest I’ve pretty much stopped using StarterGui with my games at all (which are all FE). I usually put the guis into a folder in the workspace and then replicate them into the PlayerGui when needed.

One last thing on GUIs: in 99% of use cases I’ve come across you want to have StarterGui > ResetPlayerGuiOnSpawn unchecked. It’s checked by default, but  I usually want my guis to come back when a player respawns.