Bug fix in LightmapRenderer — Now water attenuates sunlight, new creature attribution: religion sphere

Former-commit-id: fd200afabaf318bec060a8fea9eb82da6f105aad
Former-commit-id: e035368f4d6d589bdb6822301fee763eb00df984
This commit is contained in:
Song Minjae
2016-02-25 01:28:00 +09:00
parent 19630e2147
commit c56e09505b
19 changed files with 209 additions and 171 deletions

View File

@@ -1,4 +1,5 @@
== CHALLENGING, NOT PUNISHING https://www.youtube.com/watch?v=ea6UuRTjkKs
== CHALLENGING, NOT PUNISHING == https://www.youtube.com/watch?v=ea6UuRTjkKs
1. CONSISTENT RULES 1. CONSISTENT RULES
- No arbitrary unstoppable death - No arbitrary unstoppable death
@@ -19,7 +20,7 @@
- e.g. "One-big-hit didn't worked, may I should've picked up high DPS one" - e.g. "One-big-hit didn't worked, may I should've picked up high DPS one"
== MORE DEPTH, LESS COMPLEXITY https://www.youtube.com/watch?v=jVL4st0blGU == MORE DEPTH, LESS COMPLEXITY == https://www.youtube.com/watch?v=jVL4st0blGU
1. Memorise less! 1. Memorise less!
- Less burden to, even starting the game - Less burden to, even starting the game
@@ -37,33 +38,36 @@
- Dwarf Fortress failed this! - Dwarf Fortress failed this!
== Lots of things players play with (aka don't make them bored) == Lots of things players can play with (aka don't make them bored) ==
- Combat, battle, building, mechanics, adventure, dungeon explore, spelunking - Combat, battle, building, mechanics, adventure, dungeon explore, spelunking
- Not scaled; easy combat, tough combat, tedious combat, etc. - Not scaled; easy combat, tough combat, tedious combat, etc.
== Achieving perfect imbalance https://www.youtube.com/watch?v=e31OSVZF77w == Achieving perfect imbalance == https://www.youtube.com/watch?v=e31OSVZF77w
- Make sure no matter how you skilled, your playable character cannot be good at everything - Make sure no matter how you skilled, your playable character cannot be good at everything
- Give players __wide pool of options__ to solve problem - Give players __wide pool of options__ to solve problem
(kill the boss, defend their adobe, fast transportation, etc.) (kill the boss, defend their adobe, fast transportation, etc.)
-=*## What feeling do you want to convey? ##*=-
##*=- What feeling do you want to convey to the player?
== Always think WHY would you want to add _something_ on the game == Always think WHY you want to add _something_ on the game ==
- e.g. Why you are adding RPG leveling system?
- e.g. Why are you adding RPG leveling system? What it would do to the players? How would they play with?
See also: See also: HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
==================================== ====================================
* Friendlier version of Dwarf Fortress Adventure mode == Friendlier version of Dwarf Fortress Adventure mode ==
- Yet _lots of fun_ - Yet _lots of fun_
- Add Fortress mode features by 'make your own settling' - Add Fortress mode features by 'make your own settling'
- Hard to actually die, but once you die, you're done. - Hard to actually die, but once you die, you're done.
@@ -86,28 +90,25 @@ HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
* Side view == Side view ==
* Interact menu w/ mouse right == Interact menu w/ mouse right ==
* Pixelated sprites == Pixelated sprites ==
- Use 2x sprites if rotating does not work well - Use 2x sprites if rotating does not work well
== User experience ==
### User experience ###
* Indicative mouse cursor * Indicative mouse cursor
== Game mechanics ==
### Game mechanics ###
* 24 pixels == 1 metre * 24 pixels == 1 metre
== Purpose of the game ==
### Purpose of the game ###
* Boss * Boss
- Will be mentioned/shown as absolute _evil_. - Will be mentioned/shown as absolute _evil_.
@@ -127,37 +128,3 @@ HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
- Beating boss does not ends the game, but grants an ability to - Beating boss does not ends the game, but grants an ability to
create new character as it. create new character as it.
### Making sprite ###
* Layers
- (Optional) Hair foreground
- Right arm dress
- Right arm body
- Dress
- Boot right
- Boot left
- Body
- (Optional) Hair accessory
- Hair
- Head
- Left arm dress
- Left arm body
- (Optional) SFX
* Size
- Regular sprite 'height' (hitbox height) : 40 px
- Apparent height may vary
### Chargen ###
* Select hair, colours, then compile them into single spritesheet
* NO gender distinction, but have masculine/neutral/feminine designs (in clothing, hairstyles, etc.)
* Colour: 4096 colours (12-bit 0x000 - 0xFFF)
* Base mass: 60 kg

View File

@@ -1,39 +1,39 @@
* Weapon tier == Weapon tier ==
Natural / Common Stone -> Copper -> Iron -> Silver -> Titanium Natural / Common Stone -> Copper -> Iron -> Silver -> Titanium
Forging --------------> Steel --------^ Forging --------------> Steel --------^
Exotic ('elven') Glass Aurichalcum Exotic ('elven') Glass Aurichalcum
Special (something 'adamant') ??? (Use material spec of CNT, tensile strength 180 GPa) Special (something 'adamant') ??? (Use material spec of CNT, tensile strength 180 GPa)
= Metal graphics
* Metal graphics - Gold: Hue 43, low Saturation
- Aurichalcum: Hue 43, mid-high Saturation
Gold: Hue 43, low Saturation - Copper: Hue 33,
Aurichalcum: Hue 43, mid-high Saturation - Copper rust: Hue 160
Copper: Hue 33, - Iron rust: Hue 21
Copper rust: Hue 160
Iron rust: Hue 21
* Size variation == Size variation ==
Race base weapon/tool size <- 10 [kg] Race base weapon/tool size <- 10 [kg]
Size tolerance <- (50% * str/1000), or say, 20% Size tolerance <- (50% * str/1000), or say, 20%
If the size is bigger than tolerable, weapon speed severely slows down, tools become unusable If the size is bigger than tolerable, weapon speed severely slows down, tools become unusable
if use time >= 0.75 second, the weapon/tool cannot be equipped. if use time >= 0.75 second, the weapon/tool cannot be equipped.
Small weapons gains no (dis)advantage, tools become unusable Small weapons/tools gains no (dis)advantage
Crafted tool/weapon size is dependent on the baseRaceMass. When drawing: scale by (craftedWeaponSize / baseWeaponSize)
Crafted tool/weapon size is dependent to the baseRaceMass.
* Gemstone tier == Gemstone tier ==
Topaz -> R·G·B -> Diamond·Amethyst Topaz -> R·G·B -> Diamond·Amethyst
* Colouring == Colouring ==
Natural: Use 4096 Natural: Use 4096
Magical/Surreal: Use 24 Bits Magical/Surreal: Use 24 Bits
@@ -43,3 +43,54 @@ Magical/Surreal: Use 24 Bits
- Choose Col(R40, G40, B40) from set of finite cards: - Choose Col(R40, G40, B40) from set of finite cards:
39, 39, 19, 19, 0, 0 39, 39, 19, 19, 0, 0
- MULTIPLY blend chosen colour with white texture - MULTIPLY blend chosen colour with white texture
== Roguelike identity ==
= Randomised things
- E.g. potion
Lime-coloured potion
First play: "Potion (???)"
After drank: "Potion (Healing)" is revealed.
Second (new) play: "Potion (???)"
After drank: "Potion (Neurotoxin)" is revealed.
== Making sprite ==
* Layers
- (Optional) Glow
- (Optional) Hair foreground
- Right arm dress
- Right arm body
- Dress
- Boots
- Body
- (Optional) Hair accessory
- Hair
- Head
- Left arm dress
- Left arm body
- (Optional) SFX
* Size
- Regular sprite 'height' (hitbox height) : 40 px
- Apparent height may vary
== Chargen ==
* Select hair, colours, then compile them into single spritesheet
* NO gender distinction, but have masculine/neutral/feminine looks (in clothing, hairstyles, etc.)
* Colour: 4096 colours (12-bit 0x000 - 0xFFF)
* Base mass: 60 kg
== Custom pattern making ==
- Players can create their own décors (hang on wall), dresses.
- Two looms (216 colour mode, 4096 colour mode)

View File

@@ -1,4 +0,0 @@
* Drawing
- Players can create their own décors (hang on wall), dresses.
- Two looms (216 colour mode, 4096 colour mode)

View File

@@ -0,0 +1,17 @@
# An adjacency matrix of religion sphere relationship
# 0: neutral, 1: amicable (welcoming), -1: hostile (will not barter == explicit neutrality)
# -2: enemy (this is the holy war! WAAAGH!!)
# war: WAAAGH!!
# randomness: All hail the Random Number God!
# strength: tranees; disciplinants
# brute: mostly "brute" wild mobs, or spheres that fond of bruteness
"↓from to→";"strength";"harmony";"war";"randomness";"wealth";"brute";"helix"
"strength" ; "1"; "1"; "-1"; "0"; "0"; "-1"
"harmony" ; "0"; "1"; "-1"; "-1"; "0"; "0"
"war" ; "-2"; "-2"; "1"; "-2"; "-2"; "-2"
"randomness"; "0"; "0"; "0"; "1"; "0"; "0"
"wealth" ;
"brute" ;
"helix" ;
Can't render this file because it contains an unexpected character in line 8 and column 17.

View File

@@ -5,10 +5,15 @@ import java.util.Random;
/** /**
* Created by minjaesong on 16-02-03. * Created by minjaesong on 16-02-03.
*/ */
public class Fudge3 { public class Fudge3 extends FudgeDice {
public FudgeDice create(Random rand) { /**
return new FudgeDice(rand, 3); * Define new set of fudge dice with three dice.
* @param randfunc java.util.Random or its extension
*/
public Fudge3(Random randfunc) {
super(randfunc, 3);
} }
} }

View File

@@ -12,7 +12,7 @@ public class FudgeDice {
/** /**
* Define new set of fudge dice with given counts. * Define new set of fudge dice with given counts.
* @param randfunc * @param randfunc java.util.Random or its extension
* @param counts amount of die * @param counts amount of die
*/ */
public FudgeDice(Random randfunc, int counts) { public FudgeDice(Random randfunc, int counts) {
@@ -21,8 +21,8 @@ public class FudgeDice {
} }
/** /**
* Roll dice and get result. Range: [-3, 3] for three dice * Roll dice and get result.
* @return * @return Normal distributed integer [-N , N] for diceCount of N. 0 is the most frequent return.
*/ */
public int roll() { public int roll() {
int diceResult = 0; int diceResult = 0;
@@ -34,7 +34,7 @@ public class FudgeDice {
} }
/** /**
* @return random [-1, 0, 1] * @return integer randomly picked from {-1, 0, 1}
*/ */
private int rollSingleDie() { private int rollSingleDie() {
return (randfunc.nextInt(3)) - 1; return (randfunc.nextInt(3)) - 1;

View File

@@ -51,18 +51,16 @@
(kill the boss, defend their adobe, fast transportation, etc.) (kill the boss, defend their adobe, fast transportation, etc.)
-=*## What feeling do you want to convey? ##*=-
-=*## What feeling do you want to convey to the player? ##*=-
== Always think WHY would you want to add _something_ on the game == == Always think WHY you want to add _something_ on the game ==
- e.g. Why you are adding RPG leveling system? - e.g. Why are you adding RPG leveling system? What it would do to the players? How would they play with?
See also: See also: HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
HEARTS, CLUBS, DIAMONDS, SPADES: PLAYERS WHO SUIT MUDS
==================================== ====================================

View File

@@ -76,7 +76,7 @@ public class CreatureBuildFactory {
for (String s : elemSet) { for (String s : elemSet) {
float baseValue = jsonObject.get(s).getAsFloat(); float baseValue = jsonObject.get(s).getAsFloat();
// roll fudge dice and get value [-3, 3] as [0, 6] // roll fudge dice and get value [-3, 3] as [0, 6]
int varSelected = new Fudge3().create(new HQRNG()).roll() + 3; int varSelected = new Fudge3(new HQRNG()).roll() + 3;
// get multiplier from json. Assuming percentile // get multiplier from json. Assuming percentile
int multiplier = jsonObject.get(s + "variable").getAsJsonArray().get(varSelected).getAsInt(); int multiplier = jsonObject.get(s + "variable").getAsJsonArray().get(varSelected).getAsInt();
float realValue = baseValue * multiplier / 100f; float realValue = baseValue * multiplier / 100f;
@@ -121,7 +121,7 @@ public class CreatureBuildFactory {
for (String s : elemSet) { for (String s : elemSet) {
float baseValue = 1f; float baseValue = 1f;
// roll fudge dice and get value [-3, 3] as [0, 6] // roll fudge dice and get value [-3, 3] as [0, 6]
int varSelected = new Fudge3().create(new HQRNG()).roll() + 3; int varSelected = new Fudge3(new HQRNG()).roll() + 3;
// get multiplier from json. Assuming percentile // get multiplier from json. Assuming percentile
int multiplier = jsonObject.get(s).getAsJsonArray().get(varSelected).getAsInt(); int multiplier = jsonObject.get(s).getAsJsonArray().get(varSelected).getAsInt();
float realValue = baseValue * multiplier / 100f; float realValue = baseValue * multiplier / 100f;

View File

@@ -1,5 +1,6 @@
package com.Torvald.Terrarum.Actors; package com.Torvald.Terrarum.Actors;
import com.Torvald.Rand.Fudge3;
import com.Torvald.Terrarum.Actors.Faction.Faction; import com.Torvald.Terrarum.Actors.Faction.Faction;
import com.Torvald.Terrarum.GameControl.EnumKeyFunc; import com.Torvald.Terrarum.GameControl.EnumKeyFunc;
import com.Torvald.Terrarum.GameControl.KeyMap; import com.Torvald.Terrarum.GameControl.KeyMap;
@@ -57,7 +58,7 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
private final int TSIZE = MapDrawer.TILE_SIZE; private final int TSIZE = MapDrawer.TILE_SIZE;
private char LUMINANCE_RGB = 31960; private char LUMINANCE_RGB = 31399;
private HashSet<Faction> factionSet = new HashSet<>(); private HashSet<Faction> factionSet = new HashSet<>();

View File

@@ -254,19 +254,21 @@ public class LightmapRenderer {
char thisTileOpacity = TilePropCodex.getProp(thisTerrain).getOpacity(); char thisTileOpacity = TilePropCodex.getProp(thisTerrain).getOpacity();
char sunLight = Terrarum.game.map.getGlobalLight(); char sunLight = Terrarum.game.map.getGlobalLight();
// MIX TILE
// open air // open air
if (thisTerrain == AIR && thisWall == AIR) { if (thisTerrain == AIR && thisWall == AIR) {
lightLevelThis = sunLight; lightLevelThis = sunLight;
} }
// luminous tile transparent (allows sunlight to pass) // luminous tile transparent (allows sunlight to pass)
else if (thisWall == AIR && thisTileLuminosity < COLOUR_DOMAIN_SIZE) { else if (thisWall == AIR && thisTileLuminosity > 0) {
char darkenSunlight = darkenColoured(sunLight, thisTileOpacity); char darkenSunlight = darkenColoured(sunLight, thisTileOpacity);
lightLevelThis = screenBlend(darkenSunlight, thisTileLuminosity); lightLevelThis = screenBlend(darkenSunlight, thisTileLuminosity);
} }
// luminous tile (opaque) // luminous tile (opaque)
else { else if (thisWall != AIR && thisTileLuminosity > 0) {
lightLevelThis = thisTileLuminosity; lightLevelThis = thisTileLuminosity;
} }
// END MIX TILE
// mix lantern // mix lantern
for (LightmapLantern lantern : lanterns) { for (LightmapLantern lantern : lanterns) {

View File

@@ -32,7 +32,7 @@
"27";"TILE_SNOW" ; "8205"; "6"; "0"; "N/A"; "1"; "1"; "0"; "27"; "0";"16" "27";"TILE_SNOW" ; "8205"; "6"; "0"; "N/A"; "1"; "1"; "0"; "27"; "0";"16"
"28";"TILE_ICE_FRAGILE" ; "3282"; "1"; "0"; "N/A"; "1"; "0"; "0"; "28"; "0";"16" "28";"TILE_ICE_FRAGILE" ; "3282"; "1"; "0"; "N/A"; "1"; "0"; "0"; "28"; "0";"16"
"29";"TILE_ICE_NATURAL" ; "6564"; "25"; "0"; "N/A"; "1"; "1"; "0"; "29"; "0"; "8" "29";"TILE_ICE_NATURAL" ; "6564"; "25"; "0"; "N/A"; "1"; "1"; "0"; "29"; "0"; "8"
"30";"TILE_ICE_CLEAR_MAGICAL" ; "8205"; "25"; "0"; "N/A"; "1"; "1"; "4967"; "30"; "0"; "8" "30";"TILE_ICE_CLEAR_MAGICAL" ; "8205"; "25"; "0"; "N/A"; "1"; "1";"14949"; "30"; "0"; "8"
# see scandinavian name set female of this tile id! # see scandinavian name set female of this tile id!
"31";"TILE_PLATFORM_STONE" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "31"; "0";"16" "31";"TILE_PLATFORM_STONE" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "31"; "0";"16"
"32";"TILE_PLATFORM_WOODEN" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "32"; "0";"16" "32";"TILE_PLATFORM_WOODEN" ; "0"; "0"; "0"; "N/A"; "0"; "0"; "0"; "32"; "0";"16"
Can't render this file because it contains an unexpected character in line 1 and column 12.

View File

@@ -27,4 +27,5 @@ def intFromCol(r, g, b):
def colFromNum(raw): def colFromNum(raw):
return getR40(raw), getG40(raw), getB40(raw) return getR40(raw), getG40(raw), getB40(raw)
print(intFromCol(19,39,0)) print(intFromCol(9,13,29))
print(colFromNum(31399))