Search Results
Searched for posts by 4zb4 in all forums

Showing results 121 - 130 out of 981 total
Modify your search
Posted by 4zb4, Sep 27, 2016 at 3:45 am
JoKe wrote
Is there a hierarchy with light sources though? I was under the impression that sources simply add to a light map. A hierarchy change also wouldn't do too much for the issue of darkness being non-existent.

No, on second thought I'm pretty sure you're right. So the issue is that the default lantern is near white (125, 125, 105) and other light sources just add to the total value of light in a given tile, meaning that basically everything ends up being a shade of white/yellow anyway barring very few exceptions?

We might be able to see if we could make a "light source hierarchy" though. I'll have a look at the code.
It's interesting because the RGB colour values also double as "brightness" which means that we can't ever have "black light" with 0, 0, 0 because it's just counted as regular darkness and is immediately removed by any light source.

I think that maybe splitting the "light intensity" and "light colour" into two separate things might get what we're going for here, but that might be a big change in the code.
Posted by 4zb4, Sep 27, 2016 at 2:56 am
We could have a look and see what part of the code determines that player-carried light sources are drawn over all others.

Inverting the "light source hierarchy" would certainly make things much more interesting and colourful, especially with the mutant animals, hattifatteners and light crystal golems around (although I think the crystal cave does a pretty good job with its environmental lighting as is.)

It'd be pretty cool for a new player to start sprinting away down a UT hallway because they notice a dull red light slowly encroaching on them (that is actually just an injured mutant ass or rabbit)
Posted by 4zb4, Sep 27, 2016 at 2:45 am
I've had a look into how we could pull this off.
As mentioned, the game uses item::GetTruePrice() to determine the value of any given item.

The part of GetTruePrice() that determined a mirrored item is worth $0 is as follows:

long item::GetTruePrice() const
{
  if(LifeExpectancy)
    return 0;

Basically it checks whether the item has a LifeExpectancy value, which is the time left before a mirrored item vanishes from existence.
Keep that in mind.

Next we have a look at the shop buying code, which is shop::PickupItem(...)
One of the first things that happens in this section of the code is:

long Price = ForSale->GetTruePrice();

Which would immediately flag the mirrored item as worthless (Price = 0) which would mean that attempting to pick it up would result in the "junk" message:
if(!Price)
    {
      ADD_MESSAGE("\"Thank you for cleaning that junk out of my floor.\"");
      return true;
    }

Now what we COULD do to make it so that the Mondedr shop sells you mirrored items for full price is include a check before "GetTruePrice()" is called to check whether the location is Mondedr, by appropriating some code from the New Attnam shop that refuses to buy items from you:

if(GetMaster()->GetConfig() == NEW_ATTNAM)
  {
    ADD_MESSAGE("\"Sorry, I'm only allowed to buy from "
                "Decos Bananas Co. if I wish to stay here.\"");
    return false;
  }

So we could take that, put it in shop::PickupItem() and change it to check for Mondedr as follows:

truth shop::PickupItem(character* Customer, item* ForSale, int Amount)
{

//other code happens here

if(GetMaster()->GetConfig() == MONDEDR)
  {
    //this is the same as the GetTruePrice code but without the check for LifeExpectancy (or spoilage)
    long Price = Max(ForSale->GetPrice(), ForSale->GetMaterialPrice());
  }
else
 {
   //the shop is not in Mondedr, so it treats mirrored items as junk
   long Price = ForSale->GetTruePrice();
 }

 //rest of code here
}

If we keep that inside shop::PickupItem() only, then you'd only be able to buy mirrored items at full price - attempting to sell them back would just produce the "I wouldn't take that even if you paid me!" message!
Posted by 4zb4, Sep 26, 2016 at 2:35 pm
(The idea is that they are specifically ripping you off by selling mirrored items that vanish later on.)

In practice though, yes because of how the code works.
You could probably work around this by adding a huge flat markup to items on the Mondedr shop floor, which has a double effect.

One, mirrored items would now have a cost (assuming we find a way to work around items with zero value)
Two, ACTUAL items in the shop are now exorbitantly priced, which is also in keeping with them trying to rip you off. ("Hands off beggar! That iron dagger is worth 520 gold!")
Posted by 4zb4, Sep 25, 2016 at 7:14 pm
red_kangaroo wrote
I was thinking about two more NPCs:

An old drunk who you could give potions of vodka to. He would have an extensive list for chatting, various cryptic rumors about game mechanics and secret stuff. This way, even non-spoiled player without the wiki would have a way of learning about some of the more obscure stuff. For example, he could say:

I like this idea a lot actually.
We already have some NPCs that give veiled hints on how certain things work, but having a dedicated NPC dropping initially stupid or humorous lines that are actually really helpful once you make sense of them seems like a neat idea to me.

red_kangaroo wrote
The second one could be an arena master. Similarly to the sumo arena, there would be an arena in Mondedr. you could chat with the arena master to be sent there and a monster would be generated for you to fight. This fight, however, would be to death and the monster generated would be based on your danger level (of whatever is it called), so that it is always challenging for you. If you win, you get some money for the show. This way, you could get a steady income, but not without risk - maybe raise the comparative difficulty of the monsters generated as you win more fights, so after enough fights, the monster generated would be stronger rather than equal to you.

Usual arena progression would dictate that you'd start off again below-rank enemies and the scaling ramps up dramatically from there.
I think having the first couple of fights be pre-defined might be a good idea to discourage maximizing gold early on by keeping your danger level low. For example, the first fights might be against a pack of large rats, then a lion, and then a cave bear. A low-danger-level PC could probably deal with the rats no problem, struggle with the lion and probably get mauled by the bear.

This way you provide a little gold for players who arrive early and who are smart or determined enough to beat the rats and lion, while still restricting access to the dynamic fights (and potentially infinite money) with the Cave Bear who will probably tear them a new asshole.
Once you get past the "beef gates" then you'd have free access to the dynamically generated fights that gradually ramp up based on danger level.
Posted by 4zb4, Sep 24, 2016 at 11:48 pm
Well if someone had suggested putting the steam tank in there that might be pushing it.

I just like the idea of optional neutral boss monsters really.
(and bullshitting up reasons for things)
Posted by 4zb4, Sep 24, 2016 at 5:14 pm
It could be a:
  • Zombie dragon
  • Mummy dragon
  • Bone dragon (skeletal)
  • Regular-ass dragon of some variety
  • An illusory dragon made of dark magic

Who is there:
  • Because it was summoned to defend the tomb
  • Because it was attracted by the huge piles of treasure within
  • - Because it was a regular dragon when it came to claim the treasure but has since died and become an undead (in the case of zombie/bone/mummy dragon)
  • Because it died elsewhere and was brought there by Xinroch to guard the tomb/his treasure
  • Because it fell down a sinkhole on the surface and is very lost and confused
  • To scare away intruders in exchange for a place to eat and sleep

I like the idea of it being a neutral, optional boss monster. For any of the reasons above you could enforce the neutrality by making it be asleep when you find it but it wakes up (and becomes hostile) upon being attacked or if you try to take some treasure.

If we wanted to be unoriginal we could also have it be a Dark Souls reference with it actually being an artificial dragon created by Xinroch.
Posted by 4zb4, Sep 23, 2016 at 12:58 am
chaostrom wrote
That should be "bear".

God damn it.
Posted by 4zb4, Sep 22, 2016 at 1:24 am
I'm going to use a running example to make this easier to understand through all the code. *Bear with me.
I'll keep it in quote boxes:

Quote
You have 34 HP.
You are wearing a hardened leather armor and a hardened leather belt.
You are struck in the torso by a fireball for 30 FIRE damage!


The process is as follows:

When you get hit you take a set amount of damage first, which is then reduced by other factors such as resistance:
if(!PenetrateResistance)
    Damage -= (BodyPart->GetTotalResistance(Type) >> 1) + RAND() % ((BodyPart->GetTotalResistance(Type) >> 1) + 1);

Quote
30 Fire damage - (resistance calculation result)

First the formula finds your total resistance to the damage type (e.g. Fire) by checking the bodypart that was hit and the armor that bodypart has equipped.
How this is done exactly varies by bodypart.
For example, your head takes into account first the resistance of the head itself, then the resistance value of the helmet, then the resistance value of your body armor divided by two.
Your torso takes into account the resistance of your body armor and your belt.

int humanoidtorso::GetTotalResistance(int Type) const
{
  if(Master)
  {
    int Resistance = GetResistance(Type) + Master->GetGlobalResistance(Type);

    if(GetBodyArmor())
      Resistance += GetBodyArmor()->GetResistance(Type);

    if(GetBelt())
      Resistance += GetBelt()->GetResistance(Type);

    return Resistance;
  }
  else
    return GetResistance(Type);
}

Quote
You are wearing a Hardened Leather Armor and a Hardened Leather Belt.
Hardened Leather Armor has a fire resistance of 2.

Total fire resistance = 2 + 2 = 4

The value of resistance varies by the materials your armor and bodyparts are made from. This is determined solely by the materials' value in material.dat but may be modified by special equipment, such as a Ring of Fire Resistance which adds a flat bonus of 15 FR.

Once you have the total resistance of the bodypart we divide it by 2.

Quote
Total fire resistance of your torso was 4.
4 / 2 = 2

Now the exact same calculation is run again, and run through a modulo function against a random number between 1 and 99 (simplifying things here).
This means the first number is divided by the second and the remainder left over is the result. (e.g. 15 % 4 = 3 but 15 % 3 = 0)

This is to add a small degree of randomness to the damage.

Quote
Our result from the previous section was 2.
Now we run the same calculation as before, add 1 and then modulo it against a random number between 1 and 99.

RANDOM NUMBER % (2 + 1)

Say our random number was 65

65 % 3
= 2

Add both results together and we get the total damage mitigation.

Quote
Total from first section = 2
Total from second section = 2

Damage -= 2 + 2
Damage -= 4

Total fire damage was 30
Total fire mitigation was 4

TOTAL DAMAGE OVERALL = 26 FIRE DAMAGE
This probably killed the player.

I probably made a mistake somewhere in there so feel free to correct me.

(For reference, a wand of fireballs produces an explosion with damage 75 + RAND() % 25 - RAND() % 25 and not pure fire damage on impact. Explosions have their own convoluted code that involves splitting the total strength of the explosion between physical (shrapnel, shockwave) and fire damage (blast))
Posted by 4zb4, Sep 21, 2016 at 3:33 pm
With the new fire system it could melt instead of burn?