• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:51
CEST 06:51
KST 13:51
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244ByuL, and the Limitations of Standard Play3
Community News
Stellar Fest TWO the Moon (Dec 16-20)8Weekly Cups (August 24-30): Patches' balance mod takes over2New 3v3 BGH Ladder (and more) on ShieldBattery!39Weekly Cups (August 17-23): Zerg dominate the week6Weekly Cups (August 10-16): SHIN doubles3
StarCraft 2
General
SC4ALL II: SC2 Player Announcement 6/8 - Maru Weekly Cups (August 10-16): SHIN doubles Weekly Cups (August 24-30): Patches' balance mod takes over How would you feel about frequent/monthly balance patches for SC2? Weekly Cups (August 17-23): Zerg dominate the week
Tourneys
Stellar Fest TWO the Moon (Dec 16-20) 2026 GSTL Announcement PIG STY FESTIVAL 8.0! (13 - 23 August) Sparkling Tuna Cup - Weekly Open Tournament IntoTheTV X SOOP SC2 League : Weekly & Monthly
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This Mutation # 539 Thunder Dome
Brood War
General
New 3v3 BGH Ladder (and more) on ShieldBattery! Which box art did your first copy of StarCraft 1 have? ASL22 General Discussion [Personal Project Share] Terran Defense v0.60 BW General Discussion
Tourneys
BSL LAN Party - Kraków 29-30 August - OPEN SIGNUPS [ASL22] Ro24 Group F [Megathread] Daily Proleagues Small VOD Thread 2.0
Strategy
Replay Review Process - What do you do? Game Theory for Starcraft Odyssey Mineral Stack Saturation Fighting Spirit mining rates
Other Games
General Games
General RTS Discussion Thread Nintendo Switch Thread Stormgate/Frost Giant Megathread Anyone here play Quakeworld back in the day? EVE Corporation
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread European Politico-economics QA Mega-thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! Anime Discussion Thread
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Regacy Esports: The Bh…
regacyesports
Violent Games and Crime Rate…
TrAiDoS
LOCKPICKING NOOB
LUCKY_NOOB
Cathedral Of CS And NY pizza a…
FuDDx
Please support my new stand…
Peanutsc
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7235 users

The Big Programming Thread - Page 163

Forum Index > General Forum
Post a Reply
Prev 1 161 162 163 164 165 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Sub40APM
Profile Joined August 2010
6336 Posts
September 04 2012 05:47 GMT
#3241
Ya so, wasypants has a good point. If you want to 'truly' understand you should start with a language that builds everything up from scratch. But do you have the willpower to grind through that? Because like he also said, with python you can be doing legitimately useful programs from almost day 1 and ya there will be an element of 'magic' to it in the sense that you wont actually know how what you ordered python to do worked under the hood...

I have known many more people who gave up on C and general programming than Python...
phar
Profile Joined August 2011
United States1080 Posts
September 04 2012 07:25 GMT
#3242
I would argue that to get someone interested in programming, you shouldn't hit them with a sledgehammer (C) to begin with. Attrition is going to be a lot lower if you start out actually making stuff, instead of spending 95% of your time fighting with gcc.

I would also argue that C is not a bottom-up approach. If you really want to understand wtf is going on, go like... E&M -> transistors -> architecture -> C. But, not everybody is going to want to learn the really low-level stuff. There are some people who find it fascinating (I am one of those people), but people think it's boring as ungodly fuck.

Also, most of the low level shit just does not matter for 99.9% of the software you do at a high level. Being able to modularize your code, use good designs, and make it readable so other people can mess with it is much more important (where "other people" == "you in 6 months", after you've completely forgotten wtf those 10k loc do).



All that said, if you continue programming, you really should learn C eventually because it's good for you :p
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 04 2012 07:34 GMT
#3243
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
September 04 2012 07:54 GMT
#3244
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that.

It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X".
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 04 2012 08:43 GMT
#3245
On September 04 2012 16:54 Tobberoth wrote:
Show nested quote +
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Generally, I'd say you'll want "high-level" books since you already know how to program and prefer the more technical aspects... I guess an o'rielly book or something like that.

It's also possible that Java has something like all of microsofts products, certification tests etc. The books etc for those, are the SHIT. Since the company which developed the framework etc aims to get you certified, they teach more or less everything from the ground up. Instead of going "How to start coding in X" you go "How to know everything about X".


Yeah so our "official" book is Head First Java (O'Reilly) and it's been recommended we check out the Gosling reference (since he created the language). I take it O'Reilly's text is a good book?

This stuff is a bit foreign to me as I didn't really use a text to learn Python and I used MIT's text to learn Scheme.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2012-09-05 04:05:40
September 05 2012 04:04 GMT
#3246
On September 04 2012 16:34 wherebugsgo wrote:
anyone have any tips on learning Java?

I come from a strong Lisp (Scheme specifically) background and I know Python fairly well in addition. I need to learn Java this semester. Very basic general stuff can be helpful for me. I like knowing the constraints or specifics of a language regarding its very basic ideas: things like, in Lisp everything has the value #t except for #f, whether doing tail-recursion has any benefits over regular recursion, (in Python tail-recursion has no benefit) syntax things to consider (parentheses in Lisp anyone? Also the fucking colons after all the loops in Python kept screwing me over lol)

Do you know C at all? If you know C, you already know many of the basic constraints in java, especially if you're talking about syntax. If you're any decent at the proper OO constructions in python, it won't be that hard to transition into java.

The official sun tutorials are pretty decent for a first start:

http://docs.oracle.com/javase/tutorial/

s/sun/oracle/


There's an excellent reference - Effective Java, but I'm not sure it's suitable for learning the basics. It's by Joshua Bloch, who wrote significant portions of the java language (the good parts too :p).

Yea reading through bits of it right now, doesn't seem like it'd be that useful for you. Start with a basic text or the official tutorials and see how it goes.


I also strongly suggest that you start off on the right foot and follow an actual style guide (pick one), even while you're first learning. It won't teach you anything about the language itself, but it will help other people be able to help you with your code when you inevitably have to ask for help (everyone does).

official one: http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html



Really though, just start hacking with it. Reading a book or guide isn't gonna go that far. Mess around, build shit, break stuff, ask for help.
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 05 2012 07:50 GMT
#3247
yeah, I have 0 experience with C. Having programmed a bit in Java today (I finished a few small functions, one that finds sociable pairs) I feel more comfortable, but it's still a little weird having to denote what variables are before using them and whatnot.

Thanks for the references! I'll definitely check them out.
Frigo
Profile Joined August 2009
Hungary1023 Posts
September 05 2012 09:24 GMT
#3248
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.
http://www.fimfiction.net/user/Treasure_Chest
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 05 2012 15:43 GMT
#3249
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p
LukeNukeEm
Profile Joined February 2012
31 Posts
Last Edited: 2012-09-06 00:49:37
September 05 2012 23:38 GMT
#3250
Has anyone here implemented an Octree into a raytracer/pathtracer or something similar? I'm getting somewhat frustrated T_T

edit: as usual, you try to find the answer on your own for hours and get nothing. then you post your question and find the answer on your own 5 minutes later. ^_^
DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
Last Edited: 2012-09-06 00:05:16
September 06 2012 00:01 GMT
#3251
Hello TL Programmers

A few weeks ago I decided that I wanted to learn and master HTML/CSS/Javascript and SQL.

To solidify my learnings as I went forward, I started a web based game project.

My project is Knights of Drakon, a top down oldschool RPG written entirely in JavaScript/html/css.
Link to my game

The reason I come here is to ask for some advice from seasoned programmers regarding certain game parts.

Im gonna just ask my questions and hope someone will answer

1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap

2. Same as above for a dodge system.

3. Whats the best way to code a turn based 1v1 combat versus a monster. Player attacks, then the monster attacks, so on so forth, untill one is dead. I know this one is a broad scope question, But ANY idea and input is greatly appreciated




Furthermore and possibly off topic, I have my hands full and would appreciate people partnering up with me and contributing to the site, Id love experienced people in all backgrounds, Arists, Coders, Webmaster, Gamedesigners, Level Designers, and someone to help me set up forums for the project, email me from the site or PM here

Thanks TL

"Everybody gotta die some time, righ'?" - Wraith Pilot
LukeNukeEm
Profile Joined February 2012
31 Posts
Last Edited: 2012-09-06 00:28:08
September 06 2012 00:27 GMT
#3252
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.


DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
September 06 2012 00:46 GMT
#3253
On September 06 2012 09:27 LukeNukeEm wrote:
Show nested quote +
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?
"Everybody gotta die some time, righ'?" - Wraith Pilot
LukeNukeEm
Profile Joined February 2012
31 Posts
September 06 2012 00:53 GMT
#3254
On September 06 2012 09:46 DarkGeneral wrote:
Show nested quote +
On September 06 2012 09:27 LukeNukeEm wrote:
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?


Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g:
lvlDiffModifier = 100 / (100 + 50 * lvlDiff);
dmgOut = armorModifier * lvlDiffModifier * dmgIn
Brutland
Profile Joined February 2011
United States92 Posts
Last Edited: 2012-09-06 00:57:05
September 06 2012 00:54 GMT
#3255
dmgMod= LvlMod*(100/(100+cArmor)
dmgOut=dmgIn*dmgMod

LvlMod= abs(charLvl-oppLvl)*whatever percent or modifying fn here
"I drank What?"
LukeNukeEm
Profile Joined February 2012
31 Posts
September 06 2012 00:57 GMT
#3256
On September 06 2012 09:54 Brutland wrote:
dmgMod= abs((oppLvl-charLvl))*(100/(100+cArmor)
dmgOut=dmgIn*dmgMod


this would result in getting the same modifiers for lvl4 vs lvl6 / lvl 6 vs lvl 4
Craton
Profile Blog Joined December 2009
United States17303 Posts
September 06 2012 01:09 GMT
#3257
On September 05 2012 16:50 wherebugsgo wrote:
yeah, I have 0 experience with C. Having programmed a bit in Java today (I finished a few small functions, one that finds sociable pairs) I feel more comfortable, but it's still a little weird having to denote what variables are before using them and whatnot.

Thanks for the references! I'll definitely check them out.

It feels weird as hell not to when you started the other way.
twitch.tv/cratonz
DarkGeneral
Profile Blog Joined September 2003
Canada328 Posts
September 06 2012 01:10 GMT
#3258
On September 06 2012 09:53 LukeNukeEm wrote:
Show nested quote +
On September 06 2012 09:46 DarkGeneral wrote:
On September 06 2012 09:27 LukeNukeEm wrote:
On September 06 2012 09:01 DarkGeneral wrote:
1. How do I code an Armor mitigation function/class?
For example the player has 112 armor, and is level 4, the enemy is lvl 6. How do I make it that 112 turns into a certain % reduction?
such that more player/monster level difference affects the % and also the more the static armor, the less stacking effect it has, such as a diminishing return or a softcap


You could do something like:
dmgModifier = 100 / (100 + armor);
dmgOut = dmgModifier * dmgIn;

Adjust the numbers to what you feel works best for you.




Sweet, I like that. Any ideas on how to play level difference into this calculation?


Just do the same thing again - pretend that each level is worth 50 armor or so. either work it in the existing modifier, or create a new one and multiply both, e.g:
lvlDiffModifier = 100 / (100 + 50 * lvlDiff);
dmgOut = armorModifier * lvlDiffModifier * dmgIn


Beautiful simplcity,

now for the last aspect, how would I implement diminishing returns?

As the number increases and the % approaches lets say 70% the % amount per armor point would have to curve down, what is the best way to do that?
"Everybody gotta die some time, righ'?" - Wraith Pilot
phar
Profile Joined August 2011
United States1080 Posts
September 06 2012 04:16 GMT
#3259
On September 06 2012 00:43 wherebugsgo wrote:
Show nested quote +
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p

Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\

If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy.
Who after all is today speaking about the destruction of the Armenians?
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 06 2012 05:46 GMT
#3260
On September 06 2012 13:16 phar wrote:
Show nested quote +
On September 06 2012 00:43 wherebugsgo wrote:
On September 05 2012 18:24 Frigo wrote:
I also advise you to read Clean Code and learn how to use Eclipse and its various refactor options.


Don't think I'll be using Eclipse, I like emacs too much :p

Eclipse is a huge timesaver for Java. If you're not going to be writing that much code it won't matter, but if you have to crank out like 4k loc a week, Eclipse helps with the RSI :\

If this is for ar Uni class, just use whatever you're most comfortable with. But the default auto complete / auto import / auto getter/setter /etc stuff that's built in to Eclipse is really handy.


yeah so it's for a university class (UC Berkeley) and our "official" text editor is emacs. We have been told that we can use Eclipse if we want to, but our prof made a list of things he hates about Eclipse and most of us learned on vim/emacs anyway so it's not a huge deal.

Prev 1 161 162 163 164 165 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 6h 9m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 175
ProTech114
Nina 14
StarCraft: Brood War
Britney 15008
GuemChi 2027
Leta 101
Shinee 39
Noble 26
Icarus 6
Dota 2
LuMiX1
League of Legends
JimRising 744
Counter-Strike
summit1g5944
Coldzera 1105
m0e_tv418
taco 362
minikerr90
Other Games
XaKoH 663
C9.Mang0364
ROOTCatZ140
Livibee98
[ Show 11 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1085
• Rush1053
Other Games
• Scarra814
Upcoming Events
Kung Fu Cup
6h 9m
RotterdaM Event
11h 24m
Replay Cast
19h 9m
The PondCast
1d 5h
IntoTheTV X SOOP
2 days
CranKy Ducklings
3 days
Sparkling Tuna Cup
4 days
OSC
4 days
Shopify Rebellion Sundays
4 days
Mixu vs TBD
Spirit vs TBD
Clem vs TBD
Afreeca Starleague
5 days
Soma vs Shuttle
BeSt vs Rush
[ Show More ]
WardiTV Weekly
5 days
Afreeca Starleague
6 days
Leta vs ggaemo
Jaedong vs Queen
GSL
6 days
PiGosaur Cup
6 days
Liquipedia Results

Completed

KCM Special KOR vs CHN
PiG Sty Festival 8.0
Light Tournament 2026

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
RSL Revival: Season 6
Calamity Invitational
Big Dog Cup 2026 Div 1
BLAST Open Fall 2026
Esports World Cup 2026
Esports World Cup 2026: LCQ
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026

Upcoming

Acropolis #5
Acropolis #5 - TRS
Escore Tournament S3: King of Kings
Blizzard Classic Cup 2026
Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.