I'm able to map out the path an arrow should take. The issue I have is determining blockage by the environment. My stages are fbx objects, and while I could attach a bunch of collision boxes, it would significantly increase the amount of time it takes to build a stage. I only mention floating point math because it seems like a pain in the ass to work around for the PSX. Unity obviously isn't limited in the same way (in fact it allowed me to take a tremendous shortcut in determining if units are attacking from front/side/back).
Maybe it wouldn't be that bad. I could run a script to automatically draw collision boxes from the tile down to height 0, and then just clean up manually where there are multiple heights. Then I can just use Unity's build in collision system.
0
surrealitychecklonely, but not unloveddreaming of faulty keys and latchesRegistered Userregular
Sure are. You're seeing the 2.0 models there. These were made in Blender, but even they're still placeholders. I built an improved voxel-based model in Qubicle, but I think I probably need to double it's resolution to achieve a reasonable level of detail. I don't want to put too much effort into the characters at the moment though. These sorts of projects are always getting slapped with C&Ds, so I'm sorta keeping it in the back of my mind that any day I could be required to toss a bunch of assets. It wouldn't spell the end of the project, of course, I've been kicking around RPG plots, worlds, and characters since I was a teenager.
so there's that then. I'm not going to go back and retroapply it to all the redudundant move_island_1() move_island_2() functions I've done, just yet. But this should telescope my 2k scripts down to a more manageable few hundred.
I'm going to let that soak into my system 1 thinking, and then start working with lists a bit more, too.
On the downside, opponents are totally feature creeping my game.
so there's that then. I'm not going to go back and retroapply it to all the redudundant move_island_1() move_island_2() functions I've done, just yet. But this should telescope my 2k scripts down to a more manageable few hundred.
I'm going to let that soak into my system 1 thinking, and then start working with lists a bit more, too.
On the downside, opponents are totally feature creeping my game.
Why don't you do it like this instead?
public void move_island(gameobject island)
{
island.transform.Rotate(Vector3.forward, 1);
}
Then you can call it in the update as:
move_island(island1);
move_island(island2)
If you have an indeterminate number of islands, you can even do it in a loop, like: (Pseudo code)
for each(island in islands_array)
{
move_island(island);
}
Disclaimer: not sure the syntax is correct, but function parameters and scope are pretty universal.
The proper syntax for the foreach would be:
(Note, to use a List you also need to include 'using System.Collections.Generic' at the top)
List<GameObject> allIslands
foreach(GameObject island in allIslands){
move_island(island);
}
I do something similar a lot in AOTS, where each musical line is stepping through itself, and has a public function Advance() which just advances the line to the next 16th note.
So the lines all have
public void Advance(){
//Advance sixteenth, check if still on the same note, whether the note has ended and a rest has started, etc.
}
And then there's a coroutine running that's basically
IEnumerator SixteenthTracker(){
while(gameObject){
foreach(Line line in Lines){
line.Advance();
}
yield return new WaitForSeconds(sixteenthTime); //Sixteenthtime is picked at the beginning of each piece of music, depending on the tempo
}
}
It's technically a little more complicated than that because other stuff happens each sixteenth note, to the point where the coroutine actually calls a function called AdvanceSixteenth() which handles all the crazy calls that happen on each sixteenth note, but that's the general way of having a bunch of independent things do a thing at a regular interval.
When I use my binary calculator to do 1 < 1 Or 1 < 0, I get the correct result, 11.
But when I do it in the other order, 1 < 0 Or 1 < 1, I get the result of 10. (Straight-up calculating 1 Or 1 < 1 also gives the result of 10.)
What... why?? It can't be an order-of-operations thing, because I'm using "or," so everything should just get set regardless... right?
Edit: Okay, HiPER Calc breaks it down more clearly and apparently it is an order of operations thing, but I am still baffled because bottling things up in parentheses, i.e., (1 SHL 0) OR (1 SHL 1) gives the result of 100.
Edit edit: And running this calc in GameMaker, 1 << 0 | 1 << 1, does return the correct value, 3. So. Yeah. Deeper magic. Deeper magic than I can fathom.
4 (a random value as I wanted)
5 (the very specific value that I just said)
So why isn't the 5 replaced by the random value?
Because scheduledpickup_3 is never replaced.
This is one of those things that takes some getting used to with C#, the difference between passing by value and passing by reference.
For simple things like numbers, C# only passes and worries about the value. You're not passing that integer, you're passing 5.
If you want to pass the reference for something that normally doesn't pass reference, you use almost the same code, but have to specifically say that you want to pass the reference.
4 (a random value as I wanted)
5 (the very specific value that I just said)
So why isn't the 5 replaced by the random value?
@Khavall 's explanation is right on. I would even go further and say that you're not just passing by value vs reference, the types themselves are reference types vs value types. For example, `int scheduledpickup` is one of the built-in "primitive" types, so in memory it contains the literal value 5. Reference types like `GameObject obj = new GameObject()` don't keep the entire binary object in the variable obj (for a variety of good reasons too long to get into right now). So they store a reference to that object in memory, like the address of a house.
When you say `int thing = otherInt`, it's like copying an integer from one piece of paper to another. When you say "GameObject obj = otherObj`, you're still copying what's on that piece of paper, but it's only the address, not the house. That's why when you pass arguments into functions, value types can't get changed by whatever happens inside the method, but reference types can. Accessing members of a reference type is like going to the address of the house and moving the furniture around. This metaphor is getting weird.
One idiom that works for both is something like `var myObj = GenerateObject()`. By assigning the return value of a method, you can use it outside the method regardless of whether it is a return type or reference type.
For your case:
public int island_create()
{
return UnityEngine.Random.Range(1,9);
}
scheduledPickup3 = island_create()
I assume you want to do more in island_create() than just return a randomized integer, but we can probably figure out how to pull it together by knowing where that integer should live.
There might be more going on here; the reason why I defined scheduledpickup as 5 to begin with is because it is set to 0 in a conditional which is inside another conditional inside a method called only during Update. None of these conditions are met, but it was still debug.logging as 0 during start.
I tried Khavall's method and it didn't work. Then I tried other things, like expanding the ref to other functions, then setting the int schedulepickup_1 to static, then passing it through a temporary int, etc etc. Until at one point windows froze when I tried to run the game even though there were no compiler errors.
When I use my binary calculator to do 1 < 1 Or 1 < 0, I get the correct result, 11.
But when I do it in the other order, 1 < 0 Or 1 < 1, I get the result of 10. (Straight-up calculating 1 Or 1 < 1 also gives the result of 10.)
What... why?? It can't be an order-of-operations thing, because I'm using "or," so everything should just get set regardless... right?
Edit: Okay, HiPER Calc breaks it down more clearly and apparently it is an order of operations thing, but I am still baffled because bottling things up in parentheses, i.e., (1 SHL 0) OR (1 SHL 1) gives the result of 100.
Edit edit: And running this calc in GameMaker, 1 << 0 | 1 << 1, does return the correct value, 3. So. Yeah. Deeper magic. Deeper magic than I can fathom.
You may need to be careful about the order of operations and also which operator you use. It might be a logical or rather than bitwise, and some languages implement logical a OR b as "b if a is false, otherwise a" so I might expect to get 10b from 1 << 1 or 1 << 0 in that case at least
"I'm not going to spend too much time on characters at the moment"
*spends all day in Qubicle*
+10
KoopahTroopahThe koopas, the troopas.Philadelphia, PARegistered Userregular
edited May 2017
Granted that's awesome, and I'm sure you're just building this to learn for now, I would definitely keep art stuff on as close to a standstill as possible since you can't market a straight up clone of FF Tactics. My advice would be to keep focus on the gameplay of the clone until you're comfortable with it, and then start experimenting with some of your own ideas for mechanics to twist it into it's own game. That way you can turn your learning tool into something that you can possibly release later. Especially if you're making a professional portfolio, a released game of it's own looks much better than a clone of your favorite game.
Well, I know it's not strictly about the development of the game, but with a few revisions now finished to my defence statement...
AOTS and I passed my MFA!
+8
surrealitychecklonely, but not unloveddreaming of faulty keys and latchesRegistered Userregular
i implemented a full ability state system for the player along with a reload system (which didn't exist previously). it now works that if you reload after a frame perfect dodge it reloads instantly and reflects all projectiles around you because why not
bonus; i had forgotten the enemies detect incoming projectiles, and that includes their own projectiles if they get hit by the raycasts - so they will dodge the reflected projectiles sometimes
It's pretty rad, and the basic steam version is really cheap. You can still export to FBX without the dlc plugin, it just doesn't optimize it. Which actually works out okay for me - sometimes I need those extra vertices for animation.
My first attempts were very, very "minecrafty". That Agrias up there is largely based on the models for a game called Stonehearth, which I fell in love with as soon as I saw it. But it doesn't really match the armature I have for units now. I do like the general shape of things, but I'll probably whip up a base model that has smaller feet and longer arms/legs. The level of detail on the head/face/hair is right where I want it though.
I was reading Qubicle's forum and saw that animation is coming to version 4. I wonder if they'll have Alembic export. I am temped to wait but 75$ for the indie version is not bad cause v4 is probably a ways away.
Like my wife said though, I need to finish my current project before getting on to something else, she really liked my last UE4 GameJam game so I need to have an alpha out on itch.io and greenlight before the next UE4 jam.
I'm pretty happy with the improvements to the base model over the course of the past two days. I like 3d modeling, but I hate unwrapping and texturing, so this is a lot of fun.
Edit: oh interesting, it doesn't render total black
I'm pretty happy with the improvements to the base model over the course of the past two days. I like 3d modeling, but I hate unwrapping and texturing, so this is a lot of fun.
Edit: oh interesting, it doesn't render total black
I've made some solid progress this week. I've built the ship capacitor system, which is basically space mana for guns and special modules (which I'm calling Gadgets). I've also built the status effects system for buffs and debuffs, which was -alot- more involved than I initially would have thought because I needed to write a bunch of code in a ton of different scripts to actually make the buffs / debuffs take effect, but I got it done! It's pretty cool to play around with, and will enable alot of different gameplay I am excited about.
For example being in an asteroid field will give a weapon accuracy debuff, making your turrets less accurate. I could also have a gadget that is say, an Afterburner that gives +X thrust (max speed) for Y seconds but costs Z cap power. Or an ECM module that gives X points of weapon accuracy penalty but costs Y cap power per second to operate. A module that gives accuracy bonus (which counters penalty), etc. I plan on using an MMO style bar with icons to convey this information to the player in a way that is easy to understand at a glance.
Programming the AI to use all that stuff will be loads of fun though, lol...
DarkMecha on
Steam Profile | My Art | NID: DarkMecha (SW-4787-9571-8977) | PSN: DarkMecha
I've made some solid progress this week. I've built the ship capacitor system, which is basically space mana for guns and special modules (which I'm calling Gadgets). I've also built the status effects system for buffs and debuffs, which was -alot- more involved than I initially would have thought because I needed to write a bunch of code in a ton of different scripts to actually make the buffs / debuffs take effect, but I got it done! It's pretty cool to play around with, and will enable alot of different gameplay I am excited about.
For example being in an asteroid field will give a weapon accuracy debuff, making your turrets less accurate. I could also have a gadget that is say, an Afterburner that gives +X thrust (max speed) for Y seconds but costs Z cap power. Or an ECM module that gives X points of weapon accuracy penalty but costs Y cap power per second to operate. A module that gives accuracy bonus (which counters penalty), etc. I plan on using an MMO style bar with icons to convey this information to the player in a way that is easy to understand at a glance.
Programming the AI to use all that stuff will be loads of fun though, lol...
Huh... that sounds an awful lot like the game I'm making! I'm going twin stick shooter dungeon crawler, how about you?
I've made some solid progress this week. I've built the ship capacitor system, which is basically space mana for guns and special modules (which I'm calling Gadgets). I've also built the status effects system for buffs and debuffs, which was -alot- more involved than I initially would have thought because I needed to write a bunch of code in a ton of different scripts to actually make the buffs / debuffs take effect, but I got it done! It's pretty cool to play around with, and will enable alot of different gameplay I am excited about.
For example being in an asteroid field will give a weapon accuracy debuff, making your turrets less accurate. I could also have a gadget that is say, an Afterburner that gives +X thrust (max speed) for Y seconds but costs Z cap power. Or an ECM module that gives X points of weapon accuracy penalty but costs Y cap power per second to operate. A module that gives accuracy bonus (which counters penalty), etc. I plan on using an MMO style bar with icons to convey this information to the player in a way that is easy to understand at a glance.
Programming the AI to use all that stuff will be loads of fun though, lol...
Huh... that sounds an awful lot like the game I'm making! I'm going twin stick shooter dungeon crawler, how about you?
I love making connected systems like that. It feels like a machine that needs all of its parts to operate.
Continued working on the rock-paper-scissors JRPG engine. After screwing the final bolts into place, I started work on a test bed that 1) interfaces with the engine exactly as a more graphical system would, and 2) lets you drive all of the main elements of the system so that I could test that everything works. Here's a quick snapshot of the monstrous thing:
Roughly left-to-right, top-to-bottom:
- It can show you what characters and abilities have been defined in its configuration files.
- You can pick from any of the defined characters and put copies of them in two opposed parties.
- Either party may be either human or AI-controlled.
- The AI controller has a configurable historical depth that it considers when choosing what attacks to use.
- You can assign a seed to the randomizer so that battle conditions can be replicated exactly between runs.
- You can pick your actions and targets from a series of buttons, the same way that you'd pick them in an actual game.
- None of the strings you see in the big output area come from the engine itself. Those are all interpretations of a list of "event" objects that signal all the major user-visible changes that occurred in the game state as a result of the events of the turn. So those could all be converted to animations or ignored if a more graphical engine would prefer to do so.
- Since I'm 99% anything serious that might come out of this project (I am less confident that it will really become a finished product) will be on Unity, I set up an object pool for all of the game objects that are frequently copied and shared between turns. The object pool has an auditing system that you can use to ensure the number of allocations and releases are the same across each turn in the battle engine; the audit is displayed at the far right.
As it stands, the AI can vaguely predict what it is that you're planning to do and respond with appropriate counter-actions, including sending Scissors attacks into characters it knows have been using Paper moves more frequently. What I'm still working at is just how smart to make the AI. In previous RPG battle engines, what I've done is given the objects that represent various outcomes the ability to provide an AI value, and then given the actions that represent attacks and counter-attacks a predictive mode that can return outcome objects without actually affecting the game state. The AI would then call the predictive mode for all available moves and pick from among the top X at random, weighted toward high-quality moves. However, that's both computationally expensive and possibly unnecessary. However, you can't neglect that the player will balk if the AI makes very clearly irrational moves-- such as healing itself while at full health, re-inflicting a status effect that the enemy already has, or using an element that the enemy is completely immune to. So, my current plan is to give the AI the ability to detect those obviously irrational moves and back out of making them, without going all-in on trying to consider all possible moves and outcomes.
One thing I'm particularly happy with is the abilities definitions. While a past project of mine went way too ham with letting you define conditionals and logic (to the extent that my expert language was close to Turing-complete), this one uses a compact, forward-only-parsing language to define the available skills and combatants. It's tolerant in the face of missing properties and an object's properties can be defined in any order (but not more than once). More importantly, I can define totally new abilities without ever recompiling the core code, so long as I don't try to come up with totally new status effects.
Here's the abilities file, if you're interested:
Ability
Name { Attack }
Description { A basic physical attack. }
Target SingleEnemy
Cost 0
RPS Scissors
Actions
Action
RequiresAccuracy
Accuracy 800
CausesDamage
Power 500
Elements Kinetic ;
ActionType Hurt
Variance 250
;
;
;
Ability
Name { Guard }
Description { Cuts the power of incoming attacks in half. }
Target Self
Cost 0
RPS Rock
Reactions
Reaction
TriggerState BeforeDamageCalc
Transformations
Power Ratio 500 ;
;
;
;
;
Ability
Name { Dodge }
Description { Cuts the accuracy of incoming attacks in half. }
Target Self
Cost 0
RPS Rock
Reactions
Reaction
TriggerState BeforeAccuracy
Transformations
Accuracy Ratio 500 ;
;
;
;
;
Ability
Name { Focus }
Description { Restores the user's SP. }
Target Self
Cost 0
RPS Paper
Actions
Action
CausesDamage
Power 4000
AttackStat Will
DefenseStat None
ActionType RestoreSP
Variance 500
;
;
;
Ability
Name { Charge }
Description { Raises the user's Power for 3 turns. }
Target Self
Cost 1
RPS Paper
Actions
Action
Statuses
Status PowerUp
Duration 3
InflictStat Cunning
ResistStat None
;
;
;
;
;
Ability
Name { Blazzam! }
Description { Drops two lightning bolts on the enemy, or something like that. }
Target SingleEnemy
Cost 5
RPS Scissors
Actions
Action
Elements EM Thermal ;
RequiresAccuracy
Accuracy 1000
CausesDamage
Power 750
ActionType Hurt
Variance 500
;
Action
Elements EM Thermal ;
RequiresAccuracy
Accuracy 1000
CausesDamage
Power 750
ActionType Hurt
Variance 500
;
;
;
Ability
Name { Counter }
Description { Hurts he who hurts you. }
Target Self
Cost 3
RPS Rock
Reactions
Reaction
TriggerState Hit
Actions
Action
Source Target
Target Source
Elements Kinetic ;
CausesDamage
Power 1000
ActionType Hurt
;
;
;
;
;
Ability
Name { You Too }
Description { When damaged, causes the same amount of damage to the attacker. }
Target Self
Cost 1
RPS Rock
Reactions
Reaction
TriggerState Hit
Actions
Action
InheritsDamage
Power 1000
ActionType Hurt
;
;
;
;
;
Ability
Name { Them Too }
Description { When damaged, causes half the incoming damage back to all enemies. }
Target Self
Cost 4
RPS Rock
Reactions
Reaction
TriggerState Hit
Actions
Action
Target AllEnemies
InheritsDamage
Power 500
ActionType Hurt
;
;
;
;
;
Ability
Name { Leech Life }
Description { Sucks health from the target. }
Target SingleEnemy
Cost 1
RPS Scissors
Actions
Action
Power 500
Statuses
Status Drain
Ratio 1000
;
;
ActionType Hurt
Elements Bio ;
Tags Melee ;
;
;
;
Ability
Name { Toxic }
Description { Causes damage over time to the target. }
Target SingleEnemy
Cost 2
RPS Paper
Actions
Action
Power 300
Burns
AttackStat Cunning
DefenseStat Will
Statuses
Status Burn
Duration 10
;
;
ActionType Hurt
Elements Bio ;
Tags Energy ;
;
;
;
Ability
Name { Poison Fang }
Description { Causes damage and poisons the target. }
Target SingleEnemy
Cost 3
RPS Scissors
Actions
Action
Power 750
Statuses
Status Poison
Duration 8
;
;
ActionType Hurt
Elements Kinetic Bio ;
Tags Melee ;
;
;
;
Ability
Name { Break Fist }
Description { Incredibly powerful, but its base accuracy is zero...?! }
Target SingleEnemy
Cost 4
RPS Scissors
Actions
Action
Accuracy 0
Power 4000
ActionType Hurt
Tags Melee ;
Elements Kinetic ;
;
;
;
Ability
Name { Stopper Palm }
Description { Blocks an attack with a forceful thrust that leaves the foe stunned. }
Target Self
Cost 1
RPS Rock
Reactions
Reaction
TriggerState BeforeDamageCalc
Transformations
Power Ratio 250 ;
;
;
Reaction
TriggerState Hit
Actions
Action
Statuses
Status Stun
Duration 4
;
;
;
;
;
;
;
Ability
Name { Chakra }
Description { Heals the user. }
Target Self
Cost 1
RPS Paper
Actions
Action
ActionType Heal
Power 1500
Elements Psychic ;
Tags Energy ;
;
;
;
;
The one weakness of this format is that it's tied to the C# enumerations in a lot of cases. While I can create new abilities without a recompile, if I wanted to add a new ability element like "Sonic" or a new action tag like "Morale", I'd have to recompile after adding the element or tag to the appropriate enum. It's possible to avoid that by changing the enumerated values to, say, lists or hashsets of strings and putting those into a separate collection that has to be defined ahead of the abilities (they could be defined after the abilities, but that would require a separate verification step). ... I'm getting this creeping sensation up the back of my neck that feels like I'm going to wind up doing that sooner rather than later.
The next step (after that...) is to ensure that every status effect is working the way I want it to, and then move on to prototyping a display layer in Unity.
My favorite musical instrument is the air-raid siren.
I've finally got projectiles working so that they'll hit units between the caster and the target if they can't arc over them. It took me 4 hours, and I had to basically emulate the projectile's trajectory in a single function call to see if it would collide with anything and at what point during the arc. Meaning you can now do the old trick of shooting a crossbow at a space beyond your target to hit them even if they're inside range.
A solid month for me on my 2D turn-based-arcadey-roguelikelike project. Last May 10, I posted here asking how to move from one edge of a grid to the other. Since then, I've set up my grid, a semi-procedural level generator with tile painting, smooth grid movement and wrapping, energy-based turn handling, collisions, basic bump combat, a proto-GUI that scales perfectly with the game surface to any ratio, and idle/fight/dying animations. I'm experimenting with animations that break out of the grid/tile system, and next up are basic hunting AI, projectiles, and then advanced AI for projectile enemies. It's been a lot of fun. For some reason, the programming is clicking this time. The downside is I'm hitting up on GameMaker's trial limits... I've already started burying multiple scripts into a megascript (all aboard the good script megascript), which isn't best practices. I feel sure that they'll put on a decent sale in June or July, though, so I'm really reluctant to buy a license until I have to. I'm also up in the air about which to buy; I'm working toward a mobile game, but that license is $400, and the HTML5 license at $140 would make it easier to get playtesters and feedback.
Other than buying assets, is there a decent way for non-artists to generate models, sprites, and other artwork? I think it would be fun to try some game programming, but my skills lie firmly on the programming side, not the art side.
Other than buying assets, is there a decent way for non-artists to generate models, sprites, and other artwork? I think it would be fun to try some game programming, but my skills lie firmly on the programming side, not the art side.
Several ways!
1: Use cubes anyways, because, hey, different coloured cubes read. Thomas Was Alone wasn't exactly art central, despite being art central.
2: Cheat like it's your job. Colour cubes a little and call it "Voxel based". Use cylinders and call it "Vector-graphics"(I did this so much. Look at:
. It's "style" not "Musician trying to 3-d model"!
3: Learn a little 3ds/Maya. Some stuff is pretty easy to get a handle on the basic stuff, so if you have an idea, you can probably make it
4: Fuck it, what's wrong with programmer graphics? If you're making a game that needs to sell 1m+ to survive, then you can afford art. If you're making a game for fun or for some extra scratch on the side, programmer art's fine.
Mostly though, it comes down to just ignoring the graphics if that's not your strong suit, until you either can afford good graphics, can cheat an artistic vision, or have developed such a killer gameplay that the art is incidental.
Posts
Maybe it wouldn't be that bad. I could run a script to automatically draw collision boxes from the tile down to height 0, and then just clean up manually where there are multiple heights. Then I can just use Unity's build in collision system.
its jolly
http://i.imgur.com/2K8pg6u.mp4 bonus clip
Okay, that wasn't really all that hard. The engine can now calculate the minimum arc necessary to avoid level collision.
Probably going to have to fire up the game and engineer some situations to see if there's an upper limit on the arc.
Those portraits are boss. Are they real-time cameras?
First I set;
Then I make;
public void move_island() { island_move.transform.Rotate(Vector3.forward, 1); }Then in the update I go
so there's that then. I'm not going to go back and retroapply it to all the redudundant move_island_1() move_island_2() functions I've done, just yet. But this should telescope my 2k scripts down to a more manageable few hundred.
I'm going to let that soak into my system 1 thinking, and then start working with lists a bit more, too.
On the downside, opponents are totally feature creeping my game.
Why don't you do it like this instead?
public void move_island(gameobject island) { island.transform.Rotate(Vector3.forward, 1); }Then you can call it in the update as:
If you have an indeterminate number of islands, you can even do it in a loop, like: (Pseudo code)
for each(island in islands_array) { move_island(island); }Disclaimer: not sure the syntax is correct, but function parameters and scope are pretty universal.
Unreal Engine 4 Developers Community.
I'm working on a cute little video game! Here's a link for you.
Edit: turns out you can!
Steam: Handkor
(Note, to use a List you also need to include 'using System.Collections.Generic' at the top)
List<GameObject> allIslands foreach(GameObject island in allIslands){ move_island(island); }I do something similar a lot in AOTS, where each musical line is stepping through itself, and has a public function Advance() which just advances the line to the next 16th note.
So the lines all have
public void Advance(){ //Advance sixteenth, check if still on the same note, whether the note has ended and a rest has started, etc. }And then there's a coroutine running that's basically
IEnumerator SixteenthTracker(){ while(gameObject){ foreach(Line line in Lines){ line.Advance(); } yield return new WaitForSeconds(sixteenthTime); //Sixteenthtime is picked at the beginning of each piece of music, depending on the tempo } }It's technically a little more complicated than that because other stuff happens each sixteenth note, to the point where the coroutine actually calls a function called AdvanceSixteenth() which handles all the crazy calls that happen on each sixteenth note, but that's the general way of having a bunch of independent things do a thing at a regular interval.
in Start I have the latter of which calls
public void island_create(int scheduledpickup) { scheduledpickup = UnityEngine.Random.Range(1, 9); Debug.Log(scheduledpickup.ToString(); Debug.Log(scheduledpickup_3.ToString(); }which prints
4 (a random value as I wanted)
5 (the very specific value that I just said)
So why isn't the 5 replaced by the random value?
1 << 0 = 1
1 << 1 = 10
Therefore, 1 << 0 | 1 << 1 should equal 11.
When I use my binary calculator to do 1 < 1 Or 1 < 0, I get the correct result, 11.
But when I do it in the other order, 1 < 0 Or 1 < 1, I get the result of 10. (Straight-up calculating 1 Or 1 < 1 also gives the result of 10.)
What... why?? It can't be an order-of-operations thing, because I'm using "or," so everything should just get set regardless... right?
Edit: Okay, HiPER Calc breaks it down more clearly and apparently it is an order of operations thing, but I am still baffled because bottling things up in parentheses, i.e., (1 SHL 0) OR (1 SHL 1) gives the result of 100.
Edit edit: And running this calc in GameMaker, 1 << 0 | 1 << 1, does return the correct value, 3. So. Yeah. Deeper magic. Deeper magic than I can fathom.
Because scheduledpickup_3 is never replaced.
This is one of those things that takes some getting used to with C#, the difference between passing by value and passing by reference.
For simple things like numbers, C# only passes and worries about the value. You're not passing that integer, you're passing 5.
If you want to pass the reference for something that normally doesn't pass reference, you use almost the same code, but have to specifically say that you want to pass the reference.
So in this case, it would be: the latter of which calls
public void island_create(ref int scheduledpickup) { scheduledpickup = UnityEngine.Random.Range(1, 9); Debug.Log(scheduledpickup.ToString(); Debug.Log(scheduledpickup_3.ToString(); }And it would fix the problem.The nice thing about C# is no pointers, the shitty thing about C# is no pointers.
Because scheduledpickup_3 was assigned a value of 5. You pass the variable to the method, but it is just using it's value.
@Khavall 's explanation is right on. I would even go further and say that you're not just passing by value vs reference, the types themselves are reference types vs value types. For example, `int scheduledpickup` is one of the built-in "primitive" types, so in memory it contains the literal value 5. Reference types like `GameObject obj = new GameObject()` don't keep the entire binary object in the variable obj (for a variety of good reasons too long to get into right now). So they store a reference to that object in memory, like the address of a house.
When you say `int thing = otherInt`, it's like copying an integer from one piece of paper to another. When you say "GameObject obj = otherObj`, you're still copying what's on that piece of paper, but it's only the address, not the house. That's why when you pass arguments into functions, value types can't get changed by whatever happens inside the method, but reference types can. Accessing members of a reference type is like going to the address of the house and moving the furniture around. This metaphor is getting weird.
One idiom that works for both is something like `var myObj = GenerateObject()`. By assigning the return value of a method, you can use it outside the method regardless of whether it is a return type or reference type.
For your case:
public int island_create() { return UnityEngine.Random.Range(1,9); } scheduledPickup3 = island_create()I assume you want to do more in island_create() than just return a randomized integer, but we can probably figure out how to pull it together by knowing where that integer should live.
https://stackoverflow.com/a/156787/2260120
https://stackoverflow.com/a/9792791/2260120
There might be more going on here; the reason why I defined scheduledpickup as 5 to begin with is because it is set to 0 in a conditional which is inside another conditional inside a method called only during Update. None of these conditions are met, but it was still debug.logging as 0 during start.
After the reboot Khavall's method simply worked.
*shrug*
Thanks guys!
You may need to be careful about the order of operations and also which operator you use. It might be a logical or rather than bitwise, and some languages implement logical a OR b as "b if a is false, otherwise a" so I might expect to get 10b from 1 << 1 or 1 << 0 in that case at least
*spends all day in Qubicle*
In any case, your progress is tight.
AOTS and I passed my MFA!
bonus; i had forgotten the enemies detect incoming projectiles, and that includes their own projectiles if they get hit by the raycasts - so they will dodge the reflected projectiles sometimes
http://i.imgur.com/MggNoeb.mp4
You're gonna make me buy Qubicle, I love voxelly graphics.
Steam: Handkor
My first attempts were very, very "minecrafty". That Agrias up there is largely based on the models for a game called Stonehearth, which I fell in love with as soon as I saw it. But it doesn't really match the armature I have for units now. I do like the general shape of things, but I'll probably whip up a base model that has smaller feet and longer arms/legs. The level of detail on the head/face/hair is right where I want it though.
Like my wife said though, I need to finish my current project before getting on to something else, she really liked my last UE4 GameJam game so I need to have an alpha out on itch.io and greenlight before the next UE4 jam.
Steam: Handkor
I'm pretty happy with the improvements to the base model over the course of the past two days. I like 3d modeling, but I hate unwrapping and texturing, so this is a lot of fun.
Edit: oh interesting, it doesn't render total black
PIXEL NIPS!
For example being in an asteroid field will give a weapon accuracy debuff, making your turrets less accurate. I could also have a gadget that is say, an Afterburner that gives +X thrust (max speed) for Y seconds but costs Z cap power. Or an ECM module that gives X points of weapon accuracy penalty but costs Y cap power per second to operate. A module that gives accuracy bonus (which counters penalty), etc. I plan on using an MMO style bar with icons to convey this information to the player in a way that is easy to understand at a glance.
Programming the AI to use all that stuff will be loads of fun though, lol...
Huh... that sounds an awful lot like the game I'm making! I'm going twin stick shooter dungeon crawler, how about you?
I love making connected systems like that. It feels like a machine that needs all of its parts to operate.
Steam: Handkor
Continued working on the rock-paper-scissors JRPG engine. After screwing the final bolts into place, I started work on a test bed that 1) interfaces with the engine exactly as a more graphical system would, and 2) lets you drive all of the main elements of the system so that I could test that everything works. Here's a quick snapshot of the monstrous thing:
Roughly left-to-right, top-to-bottom:
- It can show you what characters and abilities have been defined in its configuration files.
- You can pick from any of the defined characters and put copies of them in two opposed parties.
- Either party may be either human or AI-controlled.
- The AI controller has a configurable historical depth that it considers when choosing what attacks to use.
- You can assign a seed to the randomizer so that battle conditions can be replicated exactly between runs.
- You can pick your actions and targets from a series of buttons, the same way that you'd pick them in an actual game.
- None of the strings you see in the big output area come from the engine itself. Those are all interpretations of a list of "event" objects that signal all the major user-visible changes that occurred in the game state as a result of the events of the turn. So those could all be converted to animations or ignored if a more graphical engine would prefer to do so.
- Since I'm 99% anything serious that might come out of this project (I am less confident that it will really become a finished product) will be on Unity, I set up an object pool for all of the game objects that are frequently copied and shared between turns. The object pool has an auditing system that you can use to ensure the number of allocations and releases are the same across each turn in the battle engine; the audit is displayed at the far right.
As it stands, the AI can vaguely predict what it is that you're planning to do and respond with appropriate counter-actions, including sending Scissors attacks into characters it knows have been using Paper moves more frequently. What I'm still working at is just how smart to make the AI. In previous RPG battle engines, what I've done is given the objects that represent various outcomes the ability to provide an AI value, and then given the actions that represent attacks and counter-attacks a predictive mode that can return outcome objects without actually affecting the game state. The AI would then call the predictive mode for all available moves and pick from among the top X at random, weighted toward high-quality moves. However, that's both computationally expensive and possibly unnecessary. However, you can't neglect that the player will balk if the AI makes very clearly irrational moves-- such as healing itself while at full health, re-inflicting a status effect that the enemy already has, or using an element that the enemy is completely immune to. So, my current plan is to give the AI the ability to detect those obviously irrational moves and back out of making them, without going all-in on trying to consider all possible moves and outcomes.
One thing I'm particularly happy with is the abilities definitions. While a past project of mine went way too ham with letting you define conditionals and logic (to the extent that my expert language was close to Turing-complete), this one uses a compact, forward-only-parsing language to define the available skills and combatants. It's tolerant in the face of missing properties and an object's properties can be defined in any order (but not more than once). More importantly, I can define totally new abilities without ever recompiling the core code, so long as I don't try to come up with totally new status effects.
Here's the abilities file, if you're interested:
Ability Name { Attack } Description { A basic physical attack. } Target SingleEnemy Cost 0 RPS Scissors Actions Action RequiresAccuracy Accuracy 800 CausesDamage Power 500 Elements Kinetic ; ActionType Hurt Variance 250 ; ; ; Ability Name { Guard } Description { Cuts the power of incoming attacks in half. } Target Self Cost 0 RPS Rock Reactions Reaction TriggerState BeforeDamageCalc Transformations Power Ratio 500 ; ; ; ; ; Ability Name { Dodge } Description { Cuts the accuracy of incoming attacks in half. } Target Self Cost 0 RPS Rock Reactions Reaction TriggerState BeforeAccuracy Transformations Accuracy Ratio 500 ; ; ; ; ; Ability Name { Focus } Description { Restores the user's SP. } Target Self Cost 0 RPS Paper Actions Action CausesDamage Power 4000 AttackStat Will DefenseStat None ActionType RestoreSP Variance 500 ; ; ; Ability Name { Charge } Description { Raises the user's Power for 3 turns. } Target Self Cost 1 RPS Paper Actions Action Statuses Status PowerUp Duration 3 InflictStat Cunning ResistStat None ; ; ; ; ; Ability Name { Blazzam! } Description { Drops two lightning bolts on the enemy, or something like that. } Target SingleEnemy Cost 5 RPS Scissors Actions Action Elements EM Thermal ; RequiresAccuracy Accuracy 1000 CausesDamage Power 750 ActionType Hurt Variance 500 ; Action Elements EM Thermal ; RequiresAccuracy Accuracy 1000 CausesDamage Power 750 ActionType Hurt Variance 500 ; ; ; Ability Name { Counter } Description { Hurts he who hurts you. } Target Self Cost 3 RPS Rock Reactions Reaction TriggerState Hit Actions Action Source Target Target Source Elements Kinetic ; CausesDamage Power 1000 ActionType Hurt ; ; ; ; ; Ability Name { You Too } Description { When damaged, causes the same amount of damage to the attacker. } Target Self Cost 1 RPS Rock Reactions Reaction TriggerState Hit Actions Action InheritsDamage Power 1000 ActionType Hurt ; ; ; ; ; Ability Name { Them Too } Description { When damaged, causes half the incoming damage back to all enemies. } Target Self Cost 4 RPS Rock Reactions Reaction TriggerState Hit Actions Action Target AllEnemies InheritsDamage Power 500 ActionType Hurt ; ; ; ; ; Ability Name { Leech Life } Description { Sucks health from the target. } Target SingleEnemy Cost 1 RPS Scissors Actions Action Power 500 Statuses Status Drain Ratio 1000 ; ; ActionType Hurt Elements Bio ; Tags Melee ; ; ; ; Ability Name { Toxic } Description { Causes damage over time to the target. } Target SingleEnemy Cost 2 RPS Paper Actions Action Power 300 Burns AttackStat Cunning DefenseStat Will Statuses Status Burn Duration 10 ; ; ActionType Hurt Elements Bio ; Tags Energy ; ; ; ; Ability Name { Poison Fang } Description { Causes damage and poisons the target. } Target SingleEnemy Cost 3 RPS Scissors Actions Action Power 750 Statuses Status Poison Duration 8 ; ; ActionType Hurt Elements Kinetic Bio ; Tags Melee ; ; ; ; Ability Name { Break Fist } Description { Incredibly powerful, but its base accuracy is zero...?! } Target SingleEnemy Cost 4 RPS Scissors Actions Action Accuracy 0 Power 4000 ActionType Hurt Tags Melee ; Elements Kinetic ; ; ; ; Ability Name { Stopper Palm } Description { Blocks an attack with a forceful thrust that leaves the foe stunned. } Target Self Cost 1 RPS Rock Reactions Reaction TriggerState BeforeDamageCalc Transformations Power Ratio 250 ; ; ; Reaction TriggerState Hit Actions Action Statuses Status Stun Duration 4 ; ; ; ; ; ; ; Ability Name { Chakra } Description { Heals the user. } Target Self Cost 1 RPS Paper Actions Action ActionType Heal Power 1500 Elements Psychic ; Tags Energy ; ; ; ; ;The one weakness of this format is that it's tied to the C# enumerations in a lot of cases. While I can create new abilities without a recompile, if I wanted to add a new ability element like "Sonic" or a new action tag like "Morale", I'd have to recompile after adding the element or tag to the appropriate enum. It's possible to avoid that by changing the enumerated values to, say, lists or hashsets of strings and putting those into a separate collection that has to be defined ahead of the abilities (they could be defined after the abilities, but that would require a separate verification step). ... I'm getting this creeping sensation up the back of my neck that feels like I'm going to wind up doing that sooner rather than later.
The next step (after that...) is to ensure that every status effect is working the way I want it to, and then move on to prototyping a display layer in Unity.
Several ways!
1: Use cubes anyways, because, hey, different coloured cubes read. Thomas Was Alone wasn't exactly art central, despite being art central.
2: Cheat like it's your job. Colour cubes a little and call it "Voxel based". Use cylinders and call it "Vector-graphics"(I did this so much. Look at:
3: Learn a little 3ds/Maya. Some stuff is pretty easy to get a handle on the basic stuff, so if you have an idea, you can probably make it
4: Fuck it, what's wrong with programmer graphics? If you're making a game that needs to sell 1m+ to survive, then you can afford art. If you're making a game for fun or for some extra scratch on the side, programmer art's fine.
Mostly though, it comes down to just ignoring the graphics if that's not your strong suit, until you either can afford good graphics, can cheat an artistic vision, or have developed such a killer gameplay that the art is incidental.