ID:2304120
 
Code:
#define DEBUG
#define DEBUG(n) world << n
#define TICK_LEN 10
#define SECOND 10/TICK_LEN
world
hub = "YukayKaryuu.EraZ"
hub_password = "hiddenofc"
status = "Public Beta"
loop_checks=1
tick_lag=1
New()
spawn() DayCycle()
spawn() Begin()
TIME=new/obj/Time
STATISTICS=new/obj/Stats
//SRC=/new/obj/SRC
spawn(0)
TICK()

Del()
SaveYear()
SaveRules()
Save_All()
..()
var/
ticks=0

proc/Begin()
spawn() LoadYear()
spawn() LoadRules()
//spawn() LoadObjects()
spawn() LoadLogs()
spawn() WorldAutoSave()
..()
// world<<"Loaded that shit."






Problem description: Never been so confused in my life. I googled up my issue and followed the approriate diagonostics for what I've seen as far as removing the skins folder in byond and reinstalling byond, removing cfg, editting my firewall security settings, even downloading fonts I already have.

I don't know exactly what code I messed up but last night my game use to be able to run and open in a timely manner, now it doesn't open at all and hangs in the background. I check my task manager and its hanging with 40% CPU and no pop up at all.


Any ideas what type of CODE may or might've fucked this one for me?



The two examples above are the only codes I was tweaking with aswell as:

world
fps = 25
icon_size = 15
view = 5


What I originally was trying to do was fix the screen-size setting and icon size setting in the ui' and also in the game. Somehow or someway within another compile, the game just wouldnt open for me anymore. plshelp.
Not sure... but try starting with the example and slowly add stuff to see where the problem lies.
proc/Begin()
spawn() LoadYear()
spawn() LoadRules()
//spawn() LoadObjects()
spawn() LoadLogs()
spawn() WorldAutoSave()
..()


None of those spawns need to be there. ..() doesn't need to be there. That's a global proc definition. There's no super to call.


Show me DayCycle() and TICK().

world
hub = "YukayKaryuu.EraZ"
hub_password = "hiddenofc"
status = "Public Beta"
loop_checks=1
tick_lag=1
New()
spawn() DayCycle()
spawn() Begin()
TIME=new/obj/Time
STATISTICS=new/obj/Stats
//SRC=/new/obj/SRC
spawn(0)
TICK()


Also, added bonus, none of those spawns need to be there either.

This is an infinite loop in your code. Your world is hanging. Uninstalling and reinstalling, or messing with the skin isn't going to fix it because this is a code problem.

You owe yourself a read through Snippet Sunday #4

http://www.byond.com/forum/?post=1638359


Your code shows some real major misunderstandings of how the engine works at a fundamental level, and you really need to get yourself out of the habit of creating spawn()s everywhere. They don't make your game run faster. They aren't a spice or a condiment that you can just slather on code to make it better.

They are instructions. As with all instructions in all programming languages, just randomly salting a block of code with them is a recipe for disaster. They do something specific. You need to know what they do, and you need to know exactly when and why you would want to use them.
I know, I kind of got stuck with the ole'fashion sloppy-habit of DM-coding, im use to spawn and haven't really read up on alot of the newer or smoother fundamentals atleast for years now so its still little new to me. And I just remember always seeing a ..() after many parented procs in many examples and figured the same applied for global procs aswell.

I DEFINITELY need to get back in-tune with breaking this habbit and of course learning the new fundamentals but thanks a bunch.

I also managed to fix this error myself, it was in the

world
fps = 25
icon_size = 15 // <--- Changed this back to 20+ Apparently anything below 16 creates this error.
view = 5


Code, apparently that icon size was waaaayy to low for the game to even run in. Strange.
icon_size = 15 // <--- Changed this back to 20+ Apparently anything below 16 creates this error.

Why are you changing the icon size all willy nilly like that?

Do you know what icon_size does?
Well Im trying to full-screen size the map_id on my ui.

I want what shows in my login-screen to fit all corners of the map_id size itself rather than just be centered or barely touching like so:





I also changed the view coding from 5 to 32 in that pic, an obvious error :/.
Also, regarding the spawn() function and that bad code. I looked over that link and learned alot actually, usually I'd pass on tuts made by you because you show less coding examples than most, BUT- actually reading your post and doing my own toying around helped alot with understanding the true purpose of listed fundamentals.

Check out my new code & tell me if this looks more appropriate:

world
hub = "YukayKaryuu.EraZ"
hub_password = "hidden"
status = "Public Beta"
loop_checks=1
tick_lag=1
fps = 30
icon_size = 34
view = 22
New()
set waitfor = 0
Begin()
DayCycle()
TIME=new/obj/Time
STATISTICS=new/obj/Stats
//SRC=/new/obj/SRC
spawn(0)
TICK()


I have to say the start-up and everything is MUCH more smoother, definitely see an immediate difference xD.
I looked over that link and learned alot actually, usually I'd pass on tuts made by you because you show less coding examples than most

This exact attitude makes learning to program a waste of time, and it's why the majority of people who use DM will never be capable of tackling even the simplest problems on their own.

It poisons your potential. Get rid of it, bury it in the desert, and then never again make eye contact with the friend that helped you dig the hole.
In response to Yukay Karyuu
Yukay Karyuu wrote:
BUT- actually reading your post and doing my own toying around helped alot with understanding the true purpose of listed fundamentals.

Check out my new code & tell me if this looks more appropriate:

world
> hub = "YukayKaryuu.EraZ"
> hub_password = "hidden"
> status = "Public Beta"
> loop_checks=1
> tick_lag=1
> fps = 30
> icon_size = 34
> view = 22
> New()
> set waitfor = 0
> Begin()
> DayCycle()
> TIME=new/obj/Time
> STATISTICS=new/obj/Stats
> //SRC=/new/obj/SRC
> spawn(0)
> TICK()

I have to say the start-up and everything is MUCH more smoother, definitely see an immediate difference xD.


I think this was me basically catching onto my stubbornness and attempting to learn in the "proper" way by actually reading and understanding what's what as I do. Utilized google abit and the DM Ref' to further research exactly what you were talking about-- I agree, my lazy attitude is the reason for most of my mistakes but there's no reason to write any more excuses for it, I'm just trying to put a stop to it from now and picking up on where I've been going wrong.




Well Im trying to full-screen size the map_id on my ui.

I want what shows in my login-screen to fit all corners of the map_id size itself rather than just be centered or barely touching like so:

Fantastic. Let's tackle this bit.

world.icon_size affects how big tiles are, where bounding boxes are concerned.

world.view affects how many tiles show up in your map.


In the DMF editor, you can mess with the properties of the skin file. The map element has a number of properties you can configure that are important to us.

map.icon-size (skin element property)
map.zoom

map.zoom is the one that's really important for us to understand. It's a value that affects how the viewport is scaled up when it's drawn in the map.

Setting map.zoom to 1 means that your map is scaled up by 1, meaning not at all.

icon size of 32 with zoom 1 means 32*1 = 32

icon size of 16 with zoom 2 means 16*2 = 32

zoom can be non-integer values, but it causes visual distortion.


You need to understand the math of viewports and resolutions a little bit to really grasp this concept. The view area of a client is the number of tiles that are sent.

view_width * tile_width * zoom = displayed viewport width.

I do some deep explanation of this here:

http://www.byond.com/ forum/?post=2301165&hla=Ter13#comment23371007

But as a general rule, you can't just have your title screen show up as as filling the viewport until you have worked out your necessary view size and resolution you want to run the game at.

Working out the size of the map element you want to support is your first step toward being able to make that title screen a full screen sort of deal.

Once you have that information, you can use transform on the title screen object to scale it up to fit within your entire screen.