Welcome, Guest. Please login or register.
December 13, 2018, 01:08:38 am

ballp.it is the community forum for The F Plus.

You're only seeing part of the forum conversation. To see more, register for an account. This will give you read-only access to nearly all the forums.

Topic: Thread.setTitle("Programmers Anonymous");  (Read 12364 times)

Ambious

  • Definitely of the internet
  • Paid
  • Up the Irons!
  • 2,092
  • 105
Thread.setTitle("Programmers Anonymous");
« on: July 01, 2016, 04:20:08 pm »
A lot of people here dabble in code.
Let's share our experiences and bitch about how much we hate it but can't stop doing it anyway.
I'll go first:

My name is Ambious and I've spent my entire evening programming my first Python app.

WHO THE FUCK INVENTED THIS MESS!?
IT HAS ALL THE SYNTAX CONSISTENCY OF VISUAL BASIC!!!
AHHH!!! HOW IS THIS SHIT SO POPULAR!?
Nifty Nif

SATAN MILKSHAKE

  • some people's reactions such as the fuck,the hell,wtf, or what the hell
  • Paid
  • I have a problem and then I have another problem
    • 1,891
    • 144
Thread.setTitle("Programmers Anonymous");
« Reply #1 on: July 01, 2016, 05:26:27 pm »
I make mods in the Skyrim engine because I like tinkering with game/level/quest design.  If you want to know why Skyrim runs poorly, here's an example of how the engine works.

Let's say I want to run a script on "NPCs in the vicinity of the player".  For instance, if I need to know whether the NPC can see the player via that NPC's OnGainLOS event.

1. Make a quest that points to the player.  This is the only way to run a script on startup: making a quest.
2. Create a cloak ability that the quest script adds to the player. 
2.a. Create a magic effect on an area around the player.  This is the easiest way to affect all NPCs within a certain area.
2.b. Right now, this magic effect is going to be applied every game tick, which is going to use up a lot of computational power.  Add a script that toggles it on for a second, then off for four seconds or so.
2.c. Skyrim has 'brawls' where you're not allowed to use magic, but because this is technically magic, it'll break those brawls.  Add conditions to the magic effect that make it stop working during brawls.
3. Create a spell.  This spell is what the cloak effect casts on any NPC that comes into contact with it. 
3.a. Create a magic effect for the spell that contains a script that runs AddSpell on the targeted NPC.
4. Create a spell of the 'Ability' type. This is what the AddSpell script adds to the NPCs. Normal spells expire, abilities do not.
4.a. Create the magic effect for that ability.
4.b. Put whatever script you want the NPC to run into that magic effect.
4.c. Make sure to include a special conditional statement for OnDying so that when the NPC dies, it doesn't keep running the script and bloat the save game.

So essentially you make a quest that adds a spell to you that casts a spell on any NPCs in the area that adds an ability that runs the script.

This is the easiest way the modding community has found to attach scripts to nearby NPCs.
Spooks Gyro Ambious Runic
« Last Edit: July 01, 2016, 05:28:22 pm by EYE OF ZA »

Gyro

  • touched fuzzy, got dizzy
  • Paid
  • 827
  • 54
Thread.setTitle("Programmers Anonymous");
« Reply #2 on: July 02, 2016, 10:15:26 am »
I'm working on a voxel game engine in Rust because I'm a huge fucking hipster and Rust seems like a pretty good language actually. Here's the Github repo if you care: https://github.com/NotGyro/Gestalt
The latest thing I've been thinking about is whether to use Lua, Python, or C# as a scripting language for this project (in Python or C# the core engine bits would be embedded in the scripting language, rather than the other way around.) I'm leaning towards Lua, because my main problem with Lua was the "end" keyword you need to put everywhere and the global-by-default behavior, and both of those can be fixed with a little project called Moonscript, which is a transpiler and is basically CoffeeScript for Lua.

I make mods in the Skyrim engine because I like tinkering with game/level/quest design.  If you want to know why Skyrim runs poorly, here's an example of how the engine works.

Wow, okay, that's a mess. Is it any easier with SKSE?

I considered developing Skyrim mods - but every time I think "I want X feature," I go looking on Nexus and somebody has already implemented X feature.

Could you link us to some of your mods? I'm curious.
Ambious

SATAN MILKSHAKE

  • some people's reactions such as the fuck,the hell,wtf, or what the hell
  • Paid
  • I have a problem and then I have another problem
    • 1,891
    • 144
Thread.setTitle("Programmers Anonymous");
« Reply #3 on: July 02, 2016, 01:09:48 pm »
It's been a while, but I remember making something with SKSE that could run a script on all actors in a cell.  It has the functions GetNumRefs/GetNthRef that let you iterate over all objects of a certain type (like NPCs) in a cell, so presumably you could set up a cycle like the above where every four seconds you AddSpell to all NPCs matching whatever conditions you specify.  (You have to repeat it because given NPCs' schedules and the player's movements, the NPCs in a cell can change at any time. Four seconds is a good medium because at top sprinting speed a player will cross a cell in about eight seconds.)  In this case, all you'd need to make is a quest, a script for that quest to run GetNumRefs/GetNthRef/AddSpell, and the ability that contains the actual script you want the NPCs to run.

It's entirely possible that this would break the engine or be more computationally expensive, though.  Skyrim's engine is such a weird cobbled together wreck that the fact that it can run at all is a feat.

I haven't put my mods up anywhere because they're more personal experimentation about "what if I could do ___" than any kind of finished product.  I like the problem-solving more than the polishing.

Zekka

  • I AM IN INTO MATHEMATICAL CALCULATIONS AND MANY METHODS USED IN THE STOCK MARKET
  • Paid
    • 785
    • 56
Thread.setTitle("Programmers Anonymous");
« Reply #4 on: July 02, 2016, 01:17:58 pm »
I haven't put my mods up anywhere because

Oh, so they're sex mods. Just be sure to send the links discreetly or else post pseudonymously and you probably won't get ratted out.
And your Sherman Tank was burned.So we amputated it too.

duz

  • Paid
  • 366
  • 14
Thread.setTitle("Programmers Anonymous");
« Reply #5 on: July 02, 2016, 03:04:59 pm »
WHO THE FUCK INVENTED THIS MESS!?
IT HAS ALL THE SYNTAX CONSISTENCY OF VISUAL BASIC!!!
AHHH!!! HOW IS THIS SHIT SO POPULAR!?

If you think those parts of Python are bad, wait until you try to write PHP!

Ambious

  • Definitely of the internet
  • Paid
  • Up the Irons!
  • 2,092
  • 105
Thread.setTitle("Programmers Anonymous");
« Reply #6 on: July 02, 2016, 04:46:32 pm »
WHO THE FUCK INVENTED THIS MESS!?
IT HAS ALL THE SYNTAX CONSISTENCY OF VISUAL BASIC!!!
AHHH!!! HOW IS THIS SHIT SO POPULAR!?

If you think those parts of Python are bad, wait until you try to write PHP!

PHP I get.
But a language that distincts between blocks by INDENTATION just seems alien to me.

SATAN MILKSHAKE

  • some people's reactions such as the fuck,the hell,wtf, or what the hell
  • Paid
  • I have a problem and then I have another problem
    • 1,891
    • 144
Thread.setTitle("Programmers Anonymous");
« Reply #7 on: July 02, 2016, 05:15:58 pm »

Gyro

  • touched fuzzy, got dizzy
  • Paid
  • 827
  • 54
Thread.setTitle("Programmers Anonymous");
« Reply #8 on: July 02, 2016, 07:33:52 pm »
Nifty Nif Ambious A Whirring Bone-White Gleech Boots Raingear

duz

  • Paid
  • 366
  • 14
Thread.setTitle("Programmers Anonymous");
« Reply #9 on: July 02, 2016, 07:48:03 pm »
PHP I get.
But a language that distincts between blocks by INDENTATION just seems alien to me.

It's just replacing braces with indentation to make code blocks more obvious since not everyone has good highlighting in their editor.
It's also a way to force proper indentation upon your coworkers instead of having to use a linter to auto reject their commits.  Come on guys, it's part of the orientation I give you, try to keep up.


Edit: Like i said on tf2 tonight, I like helping juniors become useful programmers so feel free to pester me.
A Whirring Bone-White Gleech
« Last Edit: July 03, 2016, 12:08:26 am by duz »

Nifty Nif

  • Big Dumb Slimy Monster
  • Paid
  • powerful and can be dangreous
  • 814
  • 51
Thread.setTitle("Programmers Anonymous");
« Reply #10 on: July 02, 2016, 10:07:38 pm »
PHP I get.
But a language that distincts between blocks by INDENTATION just seems alien to me.

It's just replacing braces with indentation to make code blocks more obvious since not everyone has good highlighting in their editor.
It's also a way to force proper indentation upon your coworkers instead of having to use a linter to auto reject their commits.  Come on guys, it's part of the orientation I give you, try to keep up.

I've felt both of these ways.  Python's syntax is pretty stylish!  I like it as a way to unify indentation, especially since they specify it in their style guide (no holy wars here pls).  I mostly do Java nowadays so maybe I miss such a nice, minimal syntax. But the more I think about it, the more I think Python's whitespace-delimited blocks are on par with curly braces.

Ambious

  • Definitely of the internet
  • Paid
  • Up the Irons!
  • 2,092
  • 105
Thread.setTitle("Programmers Anonymous");
« Reply #11 on: July 03, 2016, 02:28:07 am »
Don't get me wrong, I'm always a slut for proper indentation.
I'm just so used to curly brackets and semicolons that my brain has a hard time compiling what it sees without them.

Zekka

  • I AM IN INTO MATHEMATICAL CALCULATIONS AND MANY METHODS USED IN THE STOCK MARKET
  • Paid
    • 785
    • 56
Thread.setTitle("Programmers Anonymous");
« Reply #12 on: July 03, 2016, 02:42:26 am »
C's notation actually falls into kind of a minority if you include non-imperative, non-OO languages (a lot of your imperative OO languages like Java, C++, and C#, are designedly in the lineage of C) -- but the only family I know of where indentation-sensitivity seems to be treated as a default is the ML family. C's relatives in ALGOL and BCPL did not use {} / ;.

The alternate design is usually to use keywords in place of {} / ;, or just to use a different delimiter/terminating punctuation (like Prolog's , / . )
« Last Edit: July 03, 2016, 02:44:12 am by Zekka »

Gyro

  • touched fuzzy, got dizzy
  • Paid
  • 827
  • 54
Thread.setTitle("Programmers Anonymous");
« Reply #13 on: July 03, 2016, 12:23:39 pm »
The alternate design is usually to use keywords in place of {} / ;,

I'm reaaaally not a fan of Pascal / Lua's "end" syntax. It's just more typing all the time, for no real benefit over single-character punctuation.

Zekka

  • I AM IN INTO MATHEMATICAL CALCULATIONS AND MANY METHODS USED IN THE STOCK MARKET
  • Paid
    • 785
    • 56
Thread.setTitle("Programmers Anonymous");
« Reply #14 on: July 03, 2016, 12:47:39 pm »
There was a study done that found that keyword-based syntax and indentation-based syntax were easier for new programmers to learn: https://www.quorumlanguage.com/evidence/evidence.pdf. (the full paper is unfortunately hard to find online, but from what I remember from reading it their methodology was super fair)
Gyro